select table_name, data_length from information_schema.tables where table_schema='DBNAME';
SELECT table_name, sum(DATA_LENGTH)+sum(INDEX_LENGTH)
FROM information_schema.TABLES where TABLE_SCHEMA='DBNAME' GROUP BY TABLE_NAME;
结果除以 1024*1024 为 M
改进一下
select table_name, data_length/(1024*1024) from information_schema.tables where table_schema='saku';
SELECT table_name, (sum(DATA_LENGTH)+sum(INDEX_LENGTH))/(1024*1024)
FROM information_schema.TABLES where TABLE_SCHEMA='saku' GROUP BY TABLE_NAME;