时间:2022-12-06 01:25
mysql主从同步失败的解决方法
1.首先,在从服务器中停止复制线程;
MariaDB [(none)]> STOP SLAVE;
Query OK, 0 rows affected (17.48 sec)
2.从服务器复制线程停止后,在从服务器上重置SLAVE信息;
MariaDB [(none)]> RESET SLAVE;
Query OK, 0 rows affected (0.01 sec)
3.SLAVE信息重置后,重新配置正确的CHANGE MASTER TO信息;
MariaDB [(none)]> CHANGE MASTER TO
MASTER_HOST='192.168.73.110',MASTER_USER='repluser',MASTER_PASSWORD='centos',MASTER_PORT=3306,MASTER_LOG_FILE='mysql-
bin.000003',MASTER_LOG_POS=245;
Query OK, 0 rows affected (0.01 sec)
4.最后,CHANGE MASTER TO信息配置好后,重新启动线程即可;
MariaDB [(none)]> START SLAVE;
Query OK, 0 rows affected (0.00 sec)