mysql 查询表空间占用大小

2020-07-16  本文已影响0人  那钱有着落吗

select
table_name as '数据库',
sum(table_rows) as '记录数',
sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',
sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'
from information_schema.tables
where table_schema='opcdata'
group by table_name;

image.png
上一篇 下一篇

猜你喜欢

热点阅读