Sasha Pachev sasha at
Thu Jan 1 11:17:39 MST 2009

The best way to back up a large MySQL database is via an LVM snapshot.
If that is not available, second best is FLUSH TABLES WITH READ LOCK,
tar the database directory, then UNLOCK TABLES. There is a script
mysqlsnapshot that does it for you

or you can write your own.

If you have no LVM and uptime is more important than 100% data
integrity, the following hack may be practical too, at least it is
better than no backup:

tar the data directory
copy the tarball to another server with lots of spare CPU
repair the snapshot

There will be some data loss, but no more than the rows that were
modified between FLUSH TABLES and the end of the tar operation.

The above assumes MyISAM tables.

Sasha Pachev
AskSasha Linux Consulting

Fast Running Blog.
Run. Blog. Improve. Repeat.

More information about the PLUG mailing list