关于salve上replicate-ignore-db 参数设置问题:
replicate-ignore-db = mysql
replicate-ignore-db = information_schema
master 上执行:
use mysql;
UPDATE user SET password=PASSWORD('newja01') WHERE user='root';
mysql> UPDATE user SET password=PASSWORD('newja01') WHERE user='root';
Query OK, 3 rows affected (0.05 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
此时在备库上查看:
slave:/root# mysql -uroot -p'1234567'
密码还是原来的
继续测试:
master 上执行:
use zjzc;
mysql> UPDATE mysql.user SET password=PASSWORD('kjk123') WHERE user='root';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
此时slave :
slave:/root# mysql -uroot -p'1234567'
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
报密码错误
slave的密码也被修改:
slave:/root# mysql -uroot -p'kjk123'
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 11