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

Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot.

-JP

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.