-- 查询数据库占用磁盘空间
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';