Optimize and repair all mysql databases at once

Posted On Mar 06, 2008 at 1:27 am

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)

mysqlcheck -Aor mysqlcheck -Ar 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

This topic has the following tags: