Shell-script: MySQL optimize all tables

Using myisamchk sometime requires shutting down MySQL server and that’s not very easy in certain situation. This shell script accepts a database name from input and gets all table names and runs a SQL query against these tables. Currently, it only optimizes all the tables and could be expanded to do a lot more. OPTIMIZE does a lot more, an all-in-one solution (for MyISAM tables: repair, sort index, update stats). Enjoy!

Sample Usage:


Posted

in

by

Tags:

Comments

Leave a Reply

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