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