patternsqlModerate
Is there any command to optimize all MySQL tables one by one automatically?
Viewed 0 times
tablesallanyautomaticallymysqloneoptimizecommandthere
Problem
I execute below command line statement to optimize a table:
Is there any command or statement which can optimize all the tables one by one of the selected database?
optimize table tablename;Is there any command or statement which can optimize all the tables one by one of the selected database?
Solution
I usually use mysqlcheck with --optimize and --databases combination. mysqlcheck is a command-line interface for administrators to check, optimize and repair tables.
Here is the MySQL doc : http://dev.mysql.com/doc/refman/5.5/en/mysqlcheck.html
Max.
mysqlcheck -uroot -p --optimize --databases myDatabaseHere is the MySQL doc : http://dev.mysql.com/doc/refman/5.5/en/mysqlcheck.html
Max.
Code Snippets
mysqlcheck -uroot -p --optimize --databases myDatabaseContext
StackExchange Database Administrators Q#64013, answer score: 18
Revisions (0)
No revisions yet.