Often times replication gets hosed and you have to skip a bad record. It’s easy to use:

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

But what if you have an undetermined number due an upgrade of mysql? Luckily Maatkit has a nice little script that will increment skip counter by one until it no longer sees an error. Simply grab the perl script and run it as so:

# wget http://maatkit.org/get/mk-slave-restart

# perl mk-slave-restart –verbose

Once the errors are done, you can ctrl-c out of the script and check the slave status.

Leave a Reply