How to optimize all databases twice daily on a linux box or with plesk (no more clicking optimize table, hooray!)

james January 9th, 2009

Here is the syntax to optimize all databases from your command line:
mysqlcheck -Aao -o --user=USER --password=PASSWORD

And here are the chron settings for twice per day:
0 4,16 * * * mysqlcheck -Aao -o --user=USER --password=PASSWORD

if you also want to repair and check the tables (I don’t recommend this), then here is the syntax:

mysqlcheck -Aao -o --auto-repair --user=USER --password=PASSWORD

Trackback URI | Comments RSS

Leave a Reply