Over time, database tables can become corrupted due to unexpected server shutdowns, disk issues, or software bugs. WHM provides a built-in tool to repair MySQL/MariaDB databases directly from the interface. This guide walks you through the process.
Step 1: Log in to WHM
Open your browser and navigate to https://your-server-ip:2087. Log in with your root credentials.
Step 2: Navigate to Repair a MySQL Database
In the WHM sidebar, go to Home » SQL Services » Repair a MySQL Database.
Step 3: Select the Database
From the dropdown list, select the database you wish to repair. The list displays all databases on the server.
Step 4: Repair the Database
Click the Repair Database button. WHM will run the mysqlcheck --repair command on all tables in the selected database.
Once complete, WHM will display the results of the repair operation, including any tables that were successfully repaired or errors encountered.
Important Notes
- This tool runs
REPAIR TABLEon MyISAM tables. For InnoDB tables, the repair process differs — InnoDB handles most corruption recovery automatically. If InnoDB tables are corrupted, you may need to dump and re-import the data. - Roundcube databases: WHM does not support repairing InnoDB tables for Roundcube databases through this interface to prevent performance issues.
- Always back up your database before attempting a repair, as the repair process can sometimes result in data loss for severely corrupted tables.
- For large databases, the repair process may take several minutes. Do not navigate away from the page while the repair is in progress.
Troubleshooting
- "Table does not support repair" error: This typically occurs with InnoDB tables. Try restarting the MySQL/MariaDB service first. If the issue persists, dump and re-import the database:
mysqldump db_name > backup.sql && mysql db_name < backup.sql - Database not showing in the list: The database may belong to a deleted or suspended account. Check Home » SQL Services » phpMyAdmin to verify the database exists.
- Frequent corruption: If tables keep corrupting, investigate potential hardware issues (failing disk), insufficient disk space, or the need to migrate from MyISAM to InnoDB.
For more information, see the official cPanel documentation on Repair a MySQL Database.