mariusv.com

Watch as I awkwardly stumble through life

Optimize all tables from all databases

Posted by Marius Voila on October 20, 2010 in London, U.K . — 0 comments This post contains 98 words

The following command will optimize all of your databases’ tables within MySQL. It is important to optimize tables to reduce data fragmentation.

mysqlcheck -Aop -uroot

If you are not using root replace it with your username.

-A : Check all tables in all databases. This is the same as using the –databases option and naming all the databases on the command line.

-o : optimize the tables.

-p : Prompts for a password to use when connecting to the MySQL server.

-u : The MySQL user name to use when connecting to the server.