-- 查询数据库占用磁盘空间
SELECT TABLE_SCHEMA,ROUND(SUM(DATA_LENGTH + INDEX_LENGTH)/1024/1024,2) AS 'Size(MB)' FROM information_schema.`TABLES` WHERE TABLE_SCHEMA='xcgdb' GROUP BY TABLE_SCHEMA;
-- 查询表磁盘空间占用
SELECT TABLE_NAME,ROUND((DATA_LENGTH + INDEX_LENGTH)/1024/1024,2) AS 'Size(MB)' FROM information_schema.`TABLES` WHERE TABLE_SCHEMA='xcgdb';

posted on 2024-05-20 15:27  邢帅杰  阅读(145)  评论(0编辑  收藏  举报