Optimize and Repair all MySQL databases in WHM

Sometimes server unexpectedly shut down and it cause MySQL tables to crash very easily so in that case there is a simple command to automatically optimize and repair all MySQL databases tables.

To optimize the tables we can use the following command.This is good for speed, as it also optimize the defragmented tables.

[info]mysqlcheck  –optimize –all-databases[/info]

To optimize and repair:

[info]mysqlcheck –auto-repair –check –optimize –all-databases[/info]

For those who do not have access to ssh they can still repair individual database and tables using phpmyadmin.