Home arrow Blog arrow Restarting MySQL replication after an error

Restarting MySQL replication after an error

It is easy for replication to be upset slightly, resulting in an error on the slave that stops it operating. It then gets behind the master and manual intervention is needed.

Sometimes more substantial intervention is needed, but often bypassing the error is all that is needed. Before you start, check the situation by going into a MySQL client and entering:

 show slave status\G

Look at the error to see whether it is the sort of thing that can reasonably be ignored on a slave. If so, in a MySQL client enter the following statements:

 stop slave;
 set global sql_slave_skip_counter = 1;
 start slave;
 show slave status\G

Check whether the slave is now running. Sometimes this has to be repeated - checking each time that the error can be ignored. Often this will get replication working again and the slave will catch up with the master.

#128004 • 05/18/2012 12:19pm by • Vote: Up votes (203) Down votes (128)