Talk:MySQL/Backup

From Gentoo Linux Wiki

Jump to: navigation, search

Backing up your MySQL data have better explanation

For very large databases, mysqldump can use up a very large amount of memory, hence actually backing up the raw files can be much quicker for both backing up and restoring data (though remember the tables must be locked while backing up and mysql must be taken down to do a restore). It is also possible to use LVM snapshots (assuming your databases live on a separate partition).

The most efficient way of doing a backup without affecting your live database server is to create a mysql slave replicated from the server you wish to backup, it is then possible to create snapshots without affecting the main database server. Note that a replicated slave on its own is not a valid backup, as a truncate table on the main database server will also be replicated on the slave!

Note that console redirection (mysqldump database > database.sql) may not preserve UTF-8 characters! You should use the -r option instead e.g. mysqldump database -r database.sql

Personal tools