问题: 查询slave 状态的时候 Slave_IO_Running一直是Connecting
解决方案:
重新给从库赋权限
1.先在master 上做赋权操作
mysql> grant all privileges on *.* to host111@"192.168.1.111" identified by "4555454" with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
2.在slave 上操作
mysql> stop slave;
Query OK, 0 rows affected (0.01 sec)
mysql> reset slave;
Query OK, 0 rows affected (0.01 sec)
mysql> CHANGE MASTER TO
-> MASTER_HOST='192.168.1.111',
-> MASTER_USER='host111',
-> MASTER_PASSWORD='4555454*',
-> MASTER_LOG_FILE='bin.000094',
-> MASTER_LOG_POS= 529864832;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> start slave;
Query OK, 0 rows affected (0.01 sec)
再查询从库状态
看到 Slave_IO_Running: Yes
Slave_SQL_Running: Yes
全变YES说明主从配置成功
网友评论