First page Back Continue Last page Overview Graphics
Backup Agents and Tools
Dump: Using mysqldump
The most time-tested way of doing online MySQL DB backups, the mysqldump command automatically locks and flushes your tables, and saves the output to a SQL flat file that you can easily restore from. Good for all table types.
Dump Examples:
Local backup of three tables from the mydb1 database:
# mysqldump --opt mydb1 users addresses cars>mydb1-tables.sql
Local backup of two databases:
# mysqldump --opt --databases mydb1 mydb2>mydb1-n-2.sql
Local backup of all databases:
# mysqldump --opt --all-databases > all-your-dbs.sql
Remote "pull backup" of all dbs on host dbserver.example.com
# ssh root@dbserver.example.com "mysqldump --opt
--all-databases" > dbserver-backup.sql
Notes: