当前位置:网站首页>mysql查询库大小

mysql查询库大小

2022-04-23 14:08:00 阿闰

 参考:MySQL查看数据库表容量大小_傲雪星枫-CSDN博客_mysql 查看表大小

select 
table_schema 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
group by table_schema
order by sum(data_length) desc, sum(index_length) desc;

版权声明
本文为[阿闰]所创,转载请带上原文链接,感谢
https://blog.csdn.net/wasd986523/article/details/121874808