Tuesday, December 10, 2013

Handling Errors with MYSQL replication where we want to bypass a few events that cause replication to stop

   I have run into situations where I have set up some data on a replicated server, that only relates to that server, but causes replication to stop if the main server tries to update data that is not on the replicated server.

   To check to slave status;
   Go to the console and enter
show slave status;

   This will show the state of the slave.


If you need to bypass and event in the replication log, you can use this statement to bypass a record or number of records:


SET GLOBAL sql_slave_skip_counter = N 

Issue this command and then use this command to restart the slave:

start slave;

show slave status;


Repeat as many times as needed to bypass the records that cause a problem.

No comments:

Post a Comment