I have a MySQL (5.1) master-slave replication pair and replication to the slave has failed. It failed because the master ran out of disk space and the relay-logs became corrupt. The master is now back online and working properly. Since there is this error in the log the slave process can't simply be restarted.

The server has a single 40GB InnoDB database and I would like to know what is the fastest method for getting the slave back in sync to minimize downtime.

2 Answers 2


You can try reset slave mysql command to ignore the current log file. However, you should be careful as this may result in data loss/inconsistency.

I think the safe way is to rebuild the replication from the beginning to make sure you have no data loss/inconsistency.

Copying the data dir is much more faster than exporting database using mysqldump.

First, lock the tables using:


Then, copy the data dir. So, the downtime will be the time of copying the data dir. For a more complete guide, have a look at this. You need to copy the data dir instead of using mysqldump. You need to fix the permissions after copying the data files/folders onto the slave server.

  • When you say copy the data dir, what specifically do I need to copy from the master to the slave?
    – dwhere
    Mar 3, 2011 at 17:13
  • You need to copy all the files and folder under mysql data dir such as /var/lib/mysql. This way you will replicate all databases.
    – Khaled
    Mar 4, 2011 at 11:38

If you want to start all over on the slave (which I think is safest), use myqldump with the --master-data switch. Your dump will now contain CHANGE MASTER TO MASTER_LOG_FILE and MASTER_LOG_POS. Load the the dump into your slave and your good to go.

Your Answer

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

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