There was a problem loading the comments.

How do I backup my MySQL database?

Support Portal  »  Knowledgebase  »  Viewing Article

  Print
There are three main options to backup your MySQL Database:

1 - Using our backup tool

Log into your hosting control panel and then go to Files > Backup/Restore:

Image
From this page you can then take a backup of the file or databases on the account:

Image
2 - Using phpMyAdmin

Log into your Control Panel and click on MySQL Databases. Click on the 'Login' button for the database that you wish to back up, this will start PhpMyAdmin. Select the db that you wish to backup and click on the Export tab, select the options you require and the format then click 'Go':

Image
3 - Using MySQL command line tools

To use MySQL command line tools, you will need SSH access to be enabled on your hosting account, click here for our guide. You can perform backup using the following command:

mysqldump -h servername -u username -p --add-drop-table --create-options --skip-add-locks -e --set-charset --disable-keys -Q databasename > databasedump.sql

To backup and compress your dump file:

mysqldump -h servername -u username -p --add-drop-table --create-options -e --set-charset --skip-add-locks --disable-keys -Q databasename | gzip > databasedump.sql.gz

The commands above will create the dump file in your current directory. You can download this backup file using scp or ftp for your archival purposes. If you perform this command in the public_html directory (or if you move the file into the public_html directory), you will be able to download this file from the web.

Share via
Did you find this article useful?  

Related Articles

© Eco Web Hosting