Skip navigation.
Home

Reply to comment

Speed up database backups with ease

You need a snapshot of your database to restore replication but you want to reduce your downtime what can do you?

Backing up gigs of data can take a few minutes, minutes your database is down because you wanted to ensure you get a perfect copy.

You could try the following


mysql stop
cp -ax mysql backup
mysql start

Now I am sure everyone is familiar with the above but how about


mysqladmin -u root -p flush-tables
rsync -av mysql backup
mysql stop
rsync -av mysql backup
mysql start

The above method makes sure you have a "almost" perfect copy before bringing down your db then "fixes" that copy with any minor changes before restarting the db. In my own case backup downtime went from 10 minutes to under a minute.

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 7 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.