Skip to content
SumGuy's Ramblings
Go back

Repair & Optimize all Mysql Databases one liner

Mysql tuner telling you to optimize your tables? or you just happen to be bored? Mysql optimize Reorganizes the physical storage of table data and associated index data, to reduce storage space and improve I/O efficiency when accessing the table. The exact changes made to each table depend on the storage engine used by that table. This statement does not work with views.  You should use OPTIMIZE TABLE in these cases, depending on the type of table:

This statement requires SELECT and INSERT privileges for the table.

well use this one liner to repair/optimize all your DBs in one go.

mysqlcheck --auto-repair --optimize --all-databases

voila!


Share this post on:

Previous Post
Adding extra Swap to Linux
Next Post
Remove all old installed but unused kernels