Optimize MySQL all tables

I was contacted by a friend which has the website hosted on my server. His website was pretty slow despite the fact the server is very powerful. After some debugging I optimized his tables and the website is instant fast again.

If you rather want to optimize all tables / all databases in your server then you can use the following:

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