5th February 2012

Check, repair and optimize all MySQL databases

May 21st, 2008 | by dave |

The following command will check, repair and optimize all databases on your MySQL server.

mysqlcheck -u root -p --auto-repair --check --optimize --all-databases

It is the equivalent of calling CHECK TABLE, REPAIR TABLE, ANALYZE TABLE and OPTIMZE TABLE for each table in each database on your server.

We tend to run this command directly after our scheduled backups.

Tags: ,

Post a Comment