Due to my slave mysql located at my PC that’s not always persistent online, sometimes, I forget to shutdown slave normally, and then sync job will occur error.
當你show slave status G;時,沒看到兩個YES, 就是出問題了
when you execute show slave status G; on Slave, you did not see two lines “YES”, it should be gotten problems between master and slave.
Below image shows you a normal situation, you can see two lines “YES”, once one of it turns into “NO”, you should got any problem on your Mysql replication.
And once happen, how can you do? below is some procedures for your reference.
on Slave Mysql console, please follow up the procedures as below.
1. STOP SLAVE;
2. RESET SLAVE;
after stop and reset slave, please shutdown your Mysql service on your slave side.
and on your Master, dump all of the databases you would like to replicate as below image.
and then load it into Slave as below.
and then on the Mysql Console of Slave, execute the command as below.
CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
where you replace <host>, <user>, <password> by quoted strings and
<port> by the master’s port number (3306 by default).
CHANGE MASTER TO MASTER_HOST=’125.564.12.1′, MASTER_PORT=3306, MASTER_USER=’joe’, MASTER_PASSWORD=’secret’;
and then, restart replication.
and finally, You should get your mysql replication back to normal.
another way is you use phpmyadmin to bypass the error, and reload your slave.