MySQL Restores: waiting… waiting… waiting…

There are gazillions of posts with basic instructions for using mysqldump. But unless you are looking for it, very few of these comment on the shockingly slow restore times. However, there are some good hints and tips:


Interesting to note that in recent versions of mysqldump the –opt flag is enabled by default. This speeds up the restore process as detailed here: by taking out table locks, disabling keys and performing insert on chunks of rows (c.f. RBAR).  In addition to explicitly setting the –opt flag, I disable integrity check enforced by unique constraints and foreign keys, and also added the –no-autocommit flag.

I had been hoping for a superfast speedup. But unfortunately not. Perhaps this is because the –opt flag is set by default and therefore, there are not a lot of gains to be had. This is certainly an issue for production environment. And perhaps in these cases, forking out for the enterprise backup solution is the way to go. Percona’s Xtrabackup seems to be well received here ( But I shuddered at the point where it said “stop mysql” and then later on, “fix the permissions and start mysql”. Cringe.

Finally, I can no longer deny the plunge in the MySQL DBA world, useful scripts will be continually added here:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: