Mysql 查看各个数据库中的存储大小

    8

有些时候遇到数据库报警,存储容量不够的时候,如何找到罪魁祸首呢,用这个 sql 查查吧

SELECT table_schema AS 'Database',
       table_name AS 'Table',
       ROUND(((data_length + index_length) / 1024 / 1024), 2) AS 'Size (MB)'
FROM information_schema.TABLES
WHERE table_schema NOT IN ('information_schema', 'mysql', 'performance_schema', 'sys')
ORDER BY (data_length + index_length) DESC;

QQ_1727573867454.png

消息盒子

# 暂无消息 #

只显示最新10条未读和已读信息