MySQL InnoDB集群如何更改内部Router用户的密码?

2023年 9月 12日 80.9k 0

如何更改MySQL路由器用来与集群节点通信的内部路由器用户密码?

1、要在MySQL级别更改密码,请在集群的主节点上使用以下命令:

(Mon Sep 11 11:16:11 2023)[root@GreatSQL][(none)]>select hex(authentication_string) from mysql.user where user ='mysql_router1_csrx95gqhf7g';
+------------------------------------------------------------------------------------+
| hex(authentication_string) |
+------------------------------------------------------------------------------------+
| 2A32323230413845303734304231454542453638333141423432344134383434353433334441373842 |
+------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

(Mon Sep 11 11:17:34 2023)[root@GreatSQL][(none)]>SET PASSWORD FOR mysql_router1_csrx95gqhf7g@'%' ='haisDFFef#fgs123';
Query OK, 0 rows affected (0.00 sec)

(Mon Sep 11 11:22:44 2023)[root@GreatSQL][(none)]>select hex(authentication_string) from mysql.user where user ='mysql_router1_csrx95gqhf7g';
+------------------------------------------------------------------------------------+
| hex(authentication_string) |
+------------------------------------------------------------------------------------+
| 2A35464544453241394230433331414644443946434430353936454546353841303437303745343934 |
+------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

2、密码更改后,使用以下“mysqlrouter_keyring”命令让路由器知道密码更改。对应文件的路径根据你实际环境相匹配,具体查看你的 mysqlrouter.conf

语法:mysqlrouter_keyring set --master-key-file aa/mysqlrouter.key /Users/xxx/dev/server/mysql-8.0/build/aa/data/keyring mysql_router1_i7ccreq2pub2 password

eg:
mysqlrouter_keyring set --master-key-file /etc/mysqlrouter/mysqlrouter.key /var/lib/mysqlrouter/keyring mysql_router1_csrx95gqhf7g password
value for password: --输入新密码

3、重新启动路由器进程路由器应该能够使用新密码与群集节点通信。

systemctl restart mysqlrouter

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论