Take the 2-minute tour ×
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.

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.

Please give me a solution.

Thanks and regards, Praveen

share|improve this question

1 Answer 1

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 !!!)

SET GLOBAL sql_slave_skip_counter=1;

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


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.