[admin@oceanbase69 obproxy-4.3.1.0]$ obclient -h172.16.1.69 -uroot@proxysys -P2884 -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘handshake: reading initial communication packet’, system error: 11
[admin@oceanbase69 ~]$ obclient -h172.16.1.69 -uroot@sys#obdemo -p -P2883 -Doceanbase -A
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11
obclient> CREATE USER proxyro IDENTIFIED BY ‘******’;
Query OK, 0 rows affected
obclient> GRANT SELECT ON . TO proxyro;
Query OK, 0 rows affected
obclient> SHOW GRANTS FOR proxyro;
±---------------------------------+
| Grants for proxyro@% |
±---------------------------------+
| GRANT SELECT ON . TO ‘proxyro’ |
±---------------------------------+
1 row in set
–连接测试
obclient -h192.168.2.21 -P2883 -uroot@sys -Doceanbase -A -p
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11
ALTER USER proxyro IDENTIFIED BY ‘password’; --sys租户登录进行修改
alter proxyconfig set observer_sys_password = ‘password’; --root@proxysys租户登录进行修改 2883端口
[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot -P2881 -p -c -A
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487717
Server version: OceanBase_CE 4.3.3.0 (r100000142024101215-0723f9774e5f77a1253149261ba75a94414625d0) (Built Oct 12 2024 15:58:11)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
obclient [(none)]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘‘1qaz@WSX’’ at line 1
obclient [(none)]>
[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot@sys -P2881 -p1qaz@WSX -c -A oceanbase
Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 3221487719
Server version: OceanBase_CE 4.3.3.0 (r100000142024101215-0723f9774e5f77a1253149261ba75a94414625d0) (Built Oct 12 2024 15:58:11)
Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
obclient [oceanbase]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near ‘‘1qaz@WSX’’ at line 1
obclient [oceanbase]> CREATE USER proxyro IDENTIFIED BY ‘1qaz@WSX’;
Query OK, 0 rows affected (0.152 sec)
obclient [oceanbase]> GRANT SELECT ON . TO proxyro;
Query OK, 0 rows affected (0.059 sec)
obclient [oceanbase]> quit
天极爱了用户,但是使用obproxy连接集群还是连接不上
[admin@oceanbase69 logs]$ obclient -h172.16.1.69 -uroot@sys#obdemo -P2883 -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 11
使用root@proxysys连接,默认密码为空。
[admin@db01 tmp]$ obclient -h 192.168.5.200 -u root@proxysys -P 2883 -p
Enter password:
Welcome to the OceanBase. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.25
MySQL [(none)]> alter proxyconfig set observer_sys_password = ‘SWoLCQRH’ ;
Query OK, 0 rows affected (0.001 sec)
MySQL [(none)]> show proxyconfiglike ‘%password%’;
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
| name | value | info | need_reboot | visible_level |
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
| observer_sys_password | acd251af8f718bac0889a4b1e499fd3b465bfbc2 | password for observer sys user | false | SYS |
| obproxy_sys_password | | 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 |
±--------------------------------±-----------------------------------------±-------------------------------±------------±--------------+
4 rows in set (0.000 sec)