There are various ways to create a backup of a database, and in these instructions we describe two of the most common options.
phpMyAdmin
You can create a backup of your database by using phpMyAdmin, accessible via cPanel for your web hosting account.
- Begin by logging on to cPanel.
- Then click the icon
phpMyAdmin
underDatabases
. - Once you’ve entered phpMyAdmin, you will see a list of your databases to the left. Click the one you’d like to back up.
- Now, in the menu at the top of the page, click the tab
Export
. - Finally, select the export method you want to use, either
Quick
orCustom
. If you do not know that you must set any specific options for the export, useQuick
. You also need to choose export format; chooseSQL
here. Then clickGo
to create your backup.
SSH
You can also create backups of your databases via SSH. To do this, firstly, you must connect to your account via SSH, and we have a set of instructions for that here.
Once connected via SSH, run the following command to create a backup of your database:
mysqldump -u username -p'password' dbname > /path/to/mysqlbackup.sql
Replace username
with the database username, and password
with the correct password for the database user. Also, replace dbname
with the name of the database, and enter the correct path to where you want to save the backup.