Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Backup and Compress All Databases On Your MySQL Server
rightnow=`date +%Y-%m-%d_%H-%M-%S`
/usr/bin/mysqldump -uroot -pyourpasswordfornoprompt --opt --all-databases --single-transaction | bzip2 -cq9 > /home/tyler/mysql-backups/full-$rightnow.sql.bz2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.