Portal Home > Knowledgebase > Web Hosting > Shared Hosting > Databases > How to Backup a MySQL Database


How to Backup a MySQL Database




If you plan to use the backup to restore the same instance of the database you can do this:


To Do A MySQL Database Backup

1. Login to CPanel.
2. Under "Databases" click "PHP My Admin."
3. PHP My Admin will load.
4. Select the database to backup on the left hand side.
5. Click "Export" on the tool bar.
6. Select "Quick - display only the minimal options."
7. Format: SQL
8. Click "Go"
9. The backup will automatically download through your browser. Note the download path to find it again.
10. Done.

Note: You may want to zip up the SQL backup. This will make the upload and restore faster.

To Restore A MySQL Database Backup

1. Login to CPanel.
2. Under "Databases" click "PHP My Admin."
3. PHP My Admin will load.
4. Select the database to import on the left hand side.
5. Click "Import" on the tool bar.
6. Click "Choose File" under "File to Import" and browse to the file on your file system.
7. If the SQL file you are going to import is quite large you may need to break it into several imports. This will be addressed in a separate knowledge base.
8. Uncheck Partial Import/Allow the interruption of an import.
9. Format: SQL
10. Format Options: SQL compatibility mode: None, Check Do not use AUTO_INCREMENT for zero values.
11. Click "Go"
12. Once the file is uploaded and processed you will receive a message.
13. Done.


If you plan to restore the database backup on a new install or different database instance do this:

To Do A MySQL Database Backup

1. Login to CPanel.
2. Under "Databases" click "PHP My Admin."
3. PHP My Admin will load.
4. Select the database to backup on the left hand side.
5. Under the Structure tab, check each table to backup. Normally you would check all of them.
6. Click "Export" on the tool bar.
7. Select "Quick - display only the minimal options."
8. Format: SQL
9. Click "Go"
10. The backup will automatically download through your browser. Note the download path to find it again.
11. Done.

Note: You may want to zip up the SQL backup. This will make the upload and restore faster.

To Restore A MySQL Database Backup

1. Login to CPanel.
2. Under "Databases" click "PHP My Admin."
3. PHP My Admin will load.
4. Select the database to import on the left hand side.
5. Drop all the tables from the database.
6. Click "Import" on the tool bar.
7. Click "Choose File" under "File to Import" and browse to the file on your file system.
8. If the SQL file you are going to import is quite large you may need to break it into several imports. This will be addressed in a separate knowledge base.
9. Uncheck Partial Import/Allow the interruption of an import.
10. Format: SQL
11. Format Options: SQL compatibility mode: None, Check Do not use AUTO_INCREMENT for zero values.
12. Click "Go"
13. Once the file is uploaded and processed you will receive a success message.
14. Done.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
How to repair a database (Views: 3994)