We help IT Professionals succeed at work.

MySql replication throwing an error

Hi
I am using MySQL db to for my Live DB and replicated db.

I use dbA as the Master
and dbB as the Slave

yesterday , stupidly i inserted something into dbB before inserting into dbA, and now i am getting an error saying ''Duplicate entry....'''

This has seemed to stop replication now on dbB
I have chacked the Slave_IO_RUNNING and its still YES
however SLAVE_SQL_RUNNING = NO

And it doesn't tell me how many seconds i'm behind the master at all now.

So i'm wodering what i can do to get this back working again.

I checked the ini file, and i have uncommented the sql that says
# Next row skips duplicate key errors- only use if starting replication and dbs are from different log positions
slave-skip-errors=1062

So i was hoping that it would skip over the dup error message.
I saved the ini file and then waited for mysql to catch up.
I'm not familar with this section of the db to be honest and as nothing has yet happened, i'm wondering,

Do i have to to STOP SLAVE and then
START SLAVE so that it will re read the ini file and take in to account now to ignore the duplication error.


Or if this doesn't work at all.
Should i STOP SLAVE
and take note of the MASTERS position and then
REstart the SALVE but at the location of the master?

I know i might miss some information, but it will eventually catch up won''t it?

Hopefully someone can help me?

Thanks,
Putoch
Comment
Watch Question

Database Consultant
Commented:
SET GLOBAL sql_slave_skip_counter=1
start slave

and see slave status

Author

Commented:
Do i need to first run ''Stop slave''?

STOP SLAVE
and then SET GLOBAL sql_slave_skip_counter= 1
START SLAVE

Or can i just run this with out stopping the slave?
SET GLOBAL sql_slave_skip_counter=1
start slave


Thanks a mill

Author

Commented:
thanks i used just the syntax you supplied and it worked.

however i have one question.

tehre were a lot f dup entries and so i ran the queiry a good few times to over come the dups.
however could i have changed the ini file to ignore dups,
run the query
STOP SLAVE and then
run teh query
START SLAVE

would this have worked?
thanks