There are several ways to take backups (some good, some bad, and
some will depend on your situation). Here's the thought process I
use for choosing a backup strategy.
-
- mysqldump
If your data set is small (I realize "small" is a relative term.. to qualify it, let's say
- backup everything or just certain databases or tables
- backup only the DDL
- optimize the dump for a faster restore
- make the resultant sql file more compatible with other
RDBMSes
and many more things.
However, the most important options are related to the
consistency of your backup. My favorite options are:
- --single-transaction : this option gives a consistent backup, if (and only if) the tables are using InnoDB storage engine. If you have any non-read-only MyISAM tables, then don't use this …