This article will explain how to recover deleted MySQL Database. Accidentally deleting a MySQL database can be stressful, but with Hosted.com® hosting, there are ways to recover your data if you act quickly. Recovery depends on whether you have backups available, either through cPanel’s automated backup system or manual backups you’ve created.
TABLE OF CONTENTS
Why a MySQL Database Recovery is Important
Your MySQL database contains your website’s content, configurations, and user data. Losing it can lead to downtime, broken website functionality, and potential data loss for your visitors. Recovering a deleted database ensures that your website can be restored to its previous state with minimal disruption.
How to Recover a Deleted MySQL Database
1. Login to your Hosted.com® account.
2. Navigate to your web hosting plan from the Manage Services menu.
3. Click Manage next to the hosting plan associated with your domain.

4. Click Login next to Control Panel to open cPanel.

5. In your cPanel account, navigate to Files, and click Backup or Backup Wizard. Look for database backups that were created automatically or manually.

Restore MySQL Database from cPanel Backup:
1. Select Restore a MySQL Database.
2. Choose the backup file corresponding to the deleted database.
3. Click Restore to recover the database. Once complete, your database and its tables will be restored to their previous state.
Restore MySQL Database from Manual Backup:
If you have exported a backup via phpMyAdmin or SSH (.sql or .sql.gz), you can restore it using one of the following methods:
Via phpMyAdmin:
1. Login to cPanel and open phpMyAdmin.
2. Select Databases, create a new database with the same name as the deleted one (or a new name if preferred).
3. Click Import, select your backup file, and start the import process.
Via SSH:
1. Connect to your server using SSH.
2. Run the following command to import the backup:
mysql -u username -p database_name < backup.sql
3. Replace username with your database user, database_name with the target database name, and backup.sql with the backup file path.
4. Verify the Recovery Once the restore is complete, check your website and database tables to ensure all data has been successfully recovered.
Additional Information
- Timing Matters: The sooner you attempt recovery after deletion, the higher the chance of success.
- Automated Backups: Hosted.com® provides automated daily or weekly backups depending on your hosting plan. Check your plan to see what is available.
- Manual Backups: Regularly exporting your databases via phpMyAdmin or SSH ensures you always have a fallback in case of accidental deletion.
- Partial Data Recovery: If only some tables were deleted, restoring the full database backup can still recover the missing data.
- Contact Support: When you cannot locate a backup or encounter issues during the restore, Hosted.com® support can assist in recovering your database.
- Prevention Tips: Use strong naming conventions, double-check deletion commands, and enable automated backups to reduce the risk of accidental loss.
- Testing Restored Databases: After recovery, verify all website functions are working correctly, including user accounts, content, and plugins.