How to Restore a Database in cPanel
Sometimes you may need to restore a database in your hosting without wanting to fix all the data on the host. This article will explain how to restore a .sql database in cPanel without restoring the entire hosting account. There are several methods for doing this, which we will cover in detail. Please continue reading for more information.
Methods for Restoring a Database Backup in cPanel:
- Restoring a Database Backup via the Backup Option in cPanel
- Restoring a Database Backup via phpMyAdmin
- Restoring a Database Backup via Root Access
Restoring a Database Backup via the Backup Option in cPanel
To restore a .sql backup in the cPanel control panel, you first need to log into cPanel using your shared hosting credentials. Once logged in, select the “Backup” option. As shown in the attached image, you will see various sections where you can either create a full backup of your hosting or restore a specific database.
To restore a specific database, navigate to the “Restore a MySQL Database Backup” section. Click the “Choose File” button, select your backup file, and click “Upload.”
Restoring a Database Backup via phpMyAdmin
To restore a backup through phpMyAdmin, first, log into phpMyAdmin and select the database you wish to restore. Navigate to the “Import” tab, click the “Choose File” button, select your database backup file, and then click “Go.”
Restoring a Backup via Root Access
This method is useful when you have root access to the server. You just need to input the correct database name in the following command:
mysql -p -u username database_name < file.sql