MySQL优化所有表? [英] MySQL OPTIMIZE all tables?
本文介绍了MySQL优化所有表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MySQL具有 OPTIMIZE TABLE 命令,该命令可以用于回收MySQL安装中未使用的空间.有没有一种方法(内置命令或通用存储过程)为数据库和/或服务器安装中的每个表运行此优化,还是您必须自己编写脚本?
MySQL has an OPTIMIZE TABLE command which can be used to reclaim unused space in a MySQL install. Is there a way (built-in command or common stored procedure) to run this optimization for every table in the database and/or server install, or is this something you'd have to script up yourself?
推荐答案
You can use mysqlcheck
to do this at the command line.
一个数据库:
mysqlcheck -o <db_schema_name>
所有数据库:
mysqlcheck -o --all-databases
这篇关于MySQL优化所有表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文