Mysql Backup’s

Backing up your mysql instance can be a pain.  The following two commands work great…

Your backup user only needs select and Lock table rights.

mysqldump -u username -p’password‘ -f –routines –add-drop-database table_name | bzip2 -c > /path/to/dump/location/filename.sql.bz2

And to get the stored procs

mysqldump -u username -p’password‘ -f -R –triggers –no-create-info –no-data –no-create-db –skip-opt database_name | bzip2 -c > /path/to/dump/location/filename.sql.bz2

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.