Optimize and repair all mysql databases at once Print

  • 1

There is a really handy MySql utility called mysqlcheck that allows you to do a number of actions to all databases on your mysql server at once. I am writing this specifically for Linux, but I'm sure windows and Unix versions are very similar if not exactly the same. Run this command as root (super user)

Repair & Optimize

mysqlcheck -Aor

Repair Only

mysqlcheck -Ar

Optimize Only

mysqlcheck -Ao

Argument Definitions

-A - Check all Mysql databases
-r - Repair all Mysql databases
-o - Optimize all Mysql databases

To see all of the available options, run mysqlcheck --help


Was this answer helpful?

« Back