Skip to main content

How to Restore a MySQL Database Backup in cPanel

You can restore a MySQL database from a backup file using the MySQL® Databases tool in cPanel. This process allows you to restore a database to its previous state after a corruption or a manual error.

You can restore a MySQL database from a backup file using the MySQL® Databases tool in cPanel. This process allows you to restore a database to its previous state after a corruption or a manual error.

Before you begin

You will need:

  • A valid cPanel account

  • The .sql or .sql.gz backup file of the database

  • The exact name of the database you wish to restore

Restore a MySQL Database

  1. Log in to your cPanel account.

  2. Locate the Databases section and select MySQL® Databases.

  3. Scroll down to the Restore section.

  4. Select the database you want to restore from the Restore a Database dropdown menu.

  5. Select the backup file from the Select a Backup File field.

  6. Click Restore.

Confirm the result

Once the restoration is complete, you will see a success message. You can verify the restoration by:

  • Logging into your website's administrative dashboard (such as WordPress) to ensure the content is visible.

  • Checking the database via phpMyAdmin to ensure the tables are populated.

If the restoration fails

If the restoration fails, it is often due to one of the following reasons:

  • File Size Limits: The backup file is larger than the maximum allowed size for the restoration tool.

  • Invalid File Format: The file is not a valid SQL script or is incorrectly compressed.

  • Database Name Mismatch: The file contains SQL commands that attempt to create a database with a different name than the one selected.

If you cannot restore the database using the cPanel interface, contact Hostek support with the specific error message you received.

Limitations

This procedure restores the data within the database only. It does not restore any associated files, such as images or themes, which must be restored via the File Manager or FTP.

Did this answer your question?