Server Fault is a question and answer site for system and network administrators. 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 (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.

share|improve this question
up vote 0 down vote accepted

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.

share|improve this answer
When you say copy the data dir, what specifically do I need to copy from the master to the slave? – dwhere Mar 3 '11 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 '11 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.

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.