mysql查看数据库所占用的空间

 查询某个表所占用的磁盘空间大小:

SELECT CONCAT(ROUND(SUM(data_length/1024/1024),2),'MB') AS data_length_MB,
CONCAT(ROUND(SUM(index_length/1024/1024),2),'MB') AS index_length_MB
FROM `information_schema`.tables WHERE
table_schema='db_name'
AND table_name = 'table_name';

posted on 2017-05-08 10:42  dongruiha  阅读(880)  评论(0编辑  收藏  举报

导航