美文网首页
MySql查询各数据库空间占用

MySql查询各数据库空间占用

作者: 酥苏落叶 | 来源:发表于2021-07-13 17:03 被阅读0次
SELECT
    TABLE_SCHEMA,
    concat( TRUNCATE ( sum( data_length )/ 1024 / 1024, 2 ), ' MB' ) AS data_size,
    concat( TRUNCATE ( sum( index_length )/ 1024 / 1024, 2 ), 'MB' ) AS index_size 
FROM
    information_schema.TABLES 
GROUP BY
    TABLE_SCHEMA 
ORDER BY
    data_length DESC;

相关文章

网友评论

      本文标题:MySql查询各数据库空间占用

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