Mysql: optimize all tables in all databases

Bschelst/ July 14, 2019/ Linux

In order to optimize all databases & tables within your mysql instance, you can use the code below. You can also use a more specific script, where only the tables are optimized which have 10MB free space and 10% free space.