Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MySQL master-slave replication setup. When I checked show slave status, I got the result as Slave_Sql_running:No and last error as Duplicate entry 'x' on query.

But when I tried to delete the entry from that table result shown as 0 rows affected.

I tried to fetch the record using select statement. Even then the result shown as 0 rows affected.

Then I checked slave status again. The same state persists and the same error appears.

share|improve this question
up vote 3 down vote accepted

First, let me start with a warning. Be very careful when you start messing with the data on the slave. It can really ruin the integrity of the replication setup.

That being said, if you are absolutely certain you don't want the slave to execute that particular statement, you can issue the following command on the slave:

Edit by @RolandoMySQLDBA (Just added Stop Slave; and Start Slave; Commands. +1 for You !!!)

STOP SLAVE;
SET GLOBAL sql_slave_skip_counter=1;
START SLAVE;

This will skip the next statement in the replication log and move on. Here's the documentation for reference.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.