查询数据库使用量

2023-11-22  本文已影响0人  勤劳的杯子
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
where table_schema != 'mysql' and table_schema != 'sys' and table_schema != 'performance_schema' and  table_schema != 'information_schema'
order by table_rows desc, index_length desc;
上一篇 下一篇

猜你喜欢

热点阅读