Backup a MySQL Database on Ubuntu

Backing up a MySQL database is extremely simple. Just simply create a directory as to where you want to store your backups. I typically just dump them in /var/dbbak. You can then run the following command:

/usr/bin/mysqldump -u root -p YOUR_DB_NAME | gzip > /root/dbbak/YOUR_DB_NAME_`date +%y_%m_%d`.gz

-JP


Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>