美文网首页
mysql 查询表空间占用大小

mysql 查询表空间占用大小

作者: 那钱有着落吗 | 来源:发表于2020-07-16 10:39 被阅读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

    相关文章

      网友评论

          本文标题:mysql 查询表空间占用大小

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