MySQL Replication Tools

If replication stops and the slave status shows:

Last_Errno: 1580 Last_Error: Error ‘You cannot ‘ALTER’ a log table if logging is enabled’ on query. Default database: ‘mysql’.

You need to skip over a bad query as follows:

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

This tells the slave to skip one query (which is the invalid one that caused the replication to stop). If you’d like to skip two queries, you’d use SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; instead and so on.

That’s it already. Now we can start the slave again…

mysql> START SLAVE;

check if replication is working again with the SHOW SLAVE STATUS \G;

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux, MySQL. Bookmark the permalink.