up vote 0 down vote favorite I have a Mysql Master Slave Replication which is working fine. Unfortunately I got some serious problems on my slave and the only chance I saw was to restart the whole replication.

  1. Slave was stopped

  2. I created a dump on the master with logfile and logposition informations

    mysqldump --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=2 > ~/dump.sql

  3. I dropped the database on the Slave ( to enter the fresh data )

  4. I inserted the fresh dump

  5. Reset master log file and master position with information given from the dump file

  6. Start Slave

Now everything worked fine for some minutes and I saw how the correct data was imported from the Master. But after 10 minutes, the slave stopped importing because there were some tables missing. After a second run, I found out, that the DROP DATABASE command, I executed on the Slave, was now executed again on the slave.

Even a RESET Slave and importing data then and proceeding from Step 3 didnt help.

How can I prevent that the commands, which have been executed on the slave since the DUMP, are not being executed again?

  • More specifics on step 2, please. – Rick James Mar 19 '15 at 23:20
  • Edited step 2 for more details – schingeldi Mar 19 '15 at 23:31
  • hope your dump doesn't have drop database command written in it use grep -i "drop database" filename to verify it. what if you restore the dump using source filename command in mysql prompt and see where exactly you get this error..hope it helps – Nawaz Sohail Mar 20 '15 at 2:36
  • Is Step 5 done with a CHANGE MASTER ...? – Rick James Mar 21 '15 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.