It’s possible to repair MySQL databases from WHM and cPanel. You can also mass repair MySQL databases from the command line. If you have a busy server and have had an issue like you have run out of space it’s quite possible some databases might be corrupted and these will need to be repaired. This is especially true if you’re seeing a database connection error but nothing has changed recently on the server.
Repair a single database from WHM
If you have access to WHM you can repair MySQL/Maria databases from the Home »SQL Services »Repair a MySQL Database section. Just select the database from the list and hit repair. A report will be shown after the repair has processed. It can take a while if your database is large.
Using PHPMyAdmin To Repair A Database
But, if your a cPanel Web Hosting customer or cPanel Reseller Web Hosting customer it’s likely possible you don’t have access to the repair MySQL Database section in WHM. You can still repair a database but you use PHPMyAdmin. From cPanel click PHPMyAdmin and select the database on the left. Check all tables and from the dropdown box click repair. A report will be generated after the repair has completed.
Mass Repair MySQL Databases
You can also repair all databases on a cPanel server from the command line. Before running this command ensure you have enough free Ram, at least 1GB if you have large databases. From the command line as the root user enter
mysqlcheck --all-databases -A
This command checks all MySQL and Maria databases on the cPanel server and also repairs them if any errors are found. Details of any repairs are displayed in the console.
That’s how to repair individual MySQL and Maria databases from WHM covered and how to repair your database if you only have access to cPanel covered. We’ve also covered how to repair all databases on a cPanel server
How was this article? – Mass Repair MySQL Databases
You might also like
More from cPanel
The Error: last request failed: [AUTH] Authentication failed error can be caused by a range of things. It could be …
cPanel Backups Per Account or Entire MySQL Directory? The integrated cPanel backups system allows you to take a backup of each …