Jump to content

What to Do When Your MySQL Slave Stops Unexpectedly

0
  Chuck Bell's Photo
Posted Aug 31 2010 06:31 PM

If your slave stops without warning and there is an error message, consult the documentation about the likely causes of the error and perform any repairs necessary.

Once you have corrected the error, follow this procedure to determine where to restart the slave after the event that caused the error:

  • Check the position it stopped on using the following command:

    SHOW SLAVE STATUS


  • Use Master_Log_File and Read_Master_Log_Pos to determine the next event to transfer from the master.

  • Use Relay_Master_Log_File and Exec_Master_Log_Pos to determine the next event to apply for the master log.

  • Use Relay_Log_File and Relay_Log_Pos to determine the next event to apply for the relay log.

  • Use mysqlbinlog to read the contents:

    mysqlbinlog master-log.000001
    mysqlbinlog relay-log.000001


  • Investigate the problem and, if required, remove rows in database:

    SET SQL_SLAVE_SKIP_COUNTER=1; START SLAVE


Consult the online MySQL Reference Manual for more details about MySQL replication if you're still having trouble.

Tags:
1 Subscribe


0 Replies