How do I back up my MySQL database?


There are a number of ways to back up your MySQL database.  We recommend backing up your databases regularly, especially if you are upgrading software that accesses the database.

Using eXtend Control Panel Backup

You can quickly get a backup of your database through the eXtend Control Panel MySQL Database page.

To get a backup:

  1. Log into your eXtend Control Panel
  2. Click on ‘MySQL Databases’
  3. Scroll down to the database you wish to backup
  4. Click ‘Backup’
  5. The backup will download onto your computer

Using phpMyAdmin

You can use phpMyAdmin to download a backup of your database by using ‘Export’.

  1. Log into your eXtend Control Panel
  2. Click on ‘MySQL Databases’
  3. Click ‘Manage’ on one of your databases
  4. You are now in phpMyAdmin
  5. Select the database you wish to back up
  6. Click the ‘Export’ tab
  7. Decide if you want a ‘Quick’ or ‘Custom’ download
  8. Make the changes you need
  9. Click ‘Go’
  10. Your backup will download onto your computer

Using MySQL Command Line Client in SSH

If you have SSH access to your account, you can download a backup of your MySQL database to the current directory you are in.

To create the backup:

  1. Log into your account using SSH
  2. Enter in this line:

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

Where servername is your server’s name, username is your user name, and databasename is the database’s name. You can name the backup anything as long as .sql is at the end.

To backup and compress the dump file:

  1. Enter in this line:

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

  1. Download the .gz file using FTP or if you move the file into your public_html directory, you can download it directly from your website.

Using MySQL Workbench

MySQL offers the MySQL Workbench, a piece of free software that allows you to manage, backup, and restore MySQL databases.  The software also comes packaged with the MySQL Query Browser.

To download and find out more about MySQL Workbench, please visit the MySQL site: http://dev.mysql.com/downloads/workbench/



Article ID: 5
Created On: Thu, Feb 26, 2015 at 4:43 PM
Last Updated On: Wed, Aug 18, 2021 at 11:11 AM

Online URL: https://www.heartinternet.uk/support/article/how-do-i-back-up-my-mysql-database.html