美文网首页
mysql数据库容量查询

mysql数据库容量查询

作者: jimy123 | 来源:发表于2023-01-29 10:24 被阅读0次

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;

相关文章

网友评论

      本文标题:mysql数据库容量查询

      本文链接:https://www.haomeiwen.com/subject/uelshdtx.html