【2019-04-11】Mysql监控关键命令整合
2019-04-11 本文已影响0人
夜色001
1、linux mysql客户端登陆
登录
mysql -h localhost -p -u root;
选择数据库
use database;
2、查询数据库实例各表所占存储空间
select
table_schema as '数据库',
table_name as '表名',
table_rows as '记录数',
truncate(data_length/1024/1024, 2) as '数据容量(MB)',
truncate(index_length/1024/1024, 2) as '索引容量(MB)'
from information_schema.tables
order by data_length desc, index_length desc;