MySQL – Master-Slave Replikation nach Fehler fortsetzen

During the last few weeks, I’ve spent quite a bit of time working on different proofs of concept for our MySQL servers. During my tests, I broke MySQL’s replication more than once. I always had to turn to Google to get the specific query to run to fix it, when I only wanted to skip one event.

So since it’s easier for me, I’ll keep it here on my blog. Hopefully, that can help someone else too.

So. You happen to check the status of your slave and it’s not replicating anymore. As you can see below, the Seconds_Behind_Master is NULL. That’s not good. You can also see the ID of the last error.
MySQL-Replikation
In order to get the slave to skip that transaction, you need to follow this procedure:

mysql>STOP SLAVE; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE;

You can verify with SHOW SLAVE STATUS that your slave is now functioning properly.