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)