Optimize MySQL tables

Optimize single database table:

mysql> OPTIMIZE TABLE my_table

 

Optimize entire database:

shell# mysqlcheck -op -u root your_database_name

 

Optimize ALL databases:

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

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code

This site uses Akismet to reduce spam. Learn how your comment data is processed.