OceanBase用户
proxysys是obproxy代理专用的一个租户名,只能连接到obproxy
1、root@proxysys 密码查看
root@proxysys user has super privilege, and it can only use proxy internal cmd without connect to observer
[admin@ ~]$ mysql -uroot@proxysys -h127.0.0.1 -P2883 -pproxysys Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 19 Server version: 5.6.25 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MySQL [(none)]> show users; ±-------------------------±------------------+ | Variable_name | Value | ±-------------------------±------------------+ | tx_isolation | READ-COMMITTED | | system_time_zone | +08:00 | | time_zone | +08:00 | | character_set_server | utf8mb4 | | character_set_client | utf8mb4 | | interactive_timeout | 28800 | | query_cache_size | 1048576 | | character_set_results | utf8mb4 | | max_allowed_packet | 4194304 | | sql_mode | STRICT_ALL_TABLES | | net_buffer_length | 16384 | | wait_timeout | 28800 | | lower_case_table_names | 2 | | query_cache_type | OFF | | init_connect | | | transaction_isolation | READ | | character_set_connection | utf8mb4 | | net_write_timeout | 60 | ±-------------------------±------------------+ 18 rows in set (0.00 sec) MySQL [(none)]>
查看obproxy用户和密码 MySQL [(none)]> show proxyconfig like ‘%password%’; ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ | name | value | info | need_reboot | visible_level | ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ | observer_sys_password1 | | password for observer sys user | false | SYS | | observer_sys_password | | password for observer sys user | false | SYS | | obproxy_sys_password | e3fd448c516073714189b57233c9cf428ccb1bed | password for obproxy sys user | false | SYS | | inspector_password | | password for inspector user | false | SYS | | json_config_meta_table_password | | meta table password | true | virtual | ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ 5 rows in set (0.00 sec) 通过alter命令可以对obproxy进行修改 alter proxyconfig set obproxy_sys_password=‘proxysys’; 并密码加密并持久化到配置文件中 [admin@10 ~]$ strings /home/admin/obproxy/etc/obproxy_config.bin observer_sys_password1= observer_sys_password= obproxy_sys_password=e3fd448c516073714189b57233c9cf428ccb1bed inspector_password= bt_retry_times=3 bt_instance_id= bt_env_mode=TENANT_MODE bt_local_work_mode=False
root@sys 或root自动带上sys租户 是一个超级用户,可执行obproxy相关命令,又可执行observer SQL
[admin ~]$ mysql -uroot -p -h127.0.0.1 -P2883 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 34 Server version: 5.6.25 OceanBase 3.1.3 (r10000292022032916-3d79cacb37012cf61b7cb8faf00d9a6bb152bcd1) (Built Mar 29 2022 08:20:39) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MySQL [(none)]> show databases; ±-------------------+ | Database | ±-------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | ±-------------------+ 7 rows in set (0.00 sec) MySQL [(none)]> show proxyconfig like ‘%password%’; ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ | name | value | info | need_reboot | visible_level | ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ | observer_sys_password1 | | password for observer sys user | false | SYS | | observer_sys_password | | password for observer sys user | false | SYS | | obproxy_sys_password | e3fd448c516073714189b57233c9cf428ccb1bed | password for obproxy sys user | false | SYS | | inspector_password | | password for inspector user | false | SYS | | json_config_meta_table_password | | meta table password | true | virtual | ±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+ 5 rows in set (0.00 sec) MySQL [(none)]> select user,password from mysql.user; ±-----------±------------------------------------------+ | user | password | ±-----------±------------------------------------------+ | root | | | ORAAUDITOR | *9753e2cf9d2dcd5e13c052f581c310ac70c62723 | | proxyro | | ±-----------±------------------------------------------+ 3 rows in set (0.07 sec) 这个用户会存在二个地方 1、obproxy内,用show proxyconfig like '%password%'可以查看,并持久化在obproxy文件中 2、observer内,select user,password from mysql.user where user = ‘root’; 密码存在mysql.user表中 3、如果两个密码不相同就会存在,通过obproxy无法访问,但是可以连接observer 遇到obproxy无法访问,但observer可以访问 一、修改obproxy密码 1、可以通过obd cluster edit-config obtest 修改参数 observer_sys_password 2、可以通过mysql -uroot@proxysys -h127.0.0.1 -P2883 -pproxysys 直接连接obproxy修改 二、修改observer密码 1、ALTER USER ‘root’ IDENTIFIED BY ‘password’; 使其与obproxy中observer_sys_password一致
proxyro@sys 用户只有在observer上才有,并且只有oceanbase ,information_schema两个库的权限,只能连接到obserer上
[admin@~]$ mysql -uproxyro@sys -p -h127.0.0.1 -P2881 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 3221661743 Server version: 5.7.25 OceanBase 3.1.3 (r10000292022032916-3d79cacb37012cf61b7cb8faf00d9a6bb152bcd1) (Built Mar 29 2022 08:20:39) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MySQL [(none)]> show databases; ±-------------------+ | Database | ±-------------------+ | oceanbase | | information_schema | ±-------------------+ 2 rows in set (0.00 sec)