1、查询某个表数据和其索引的大小
select DATA_LENGTH+INDEX_LENGTH from information_schema.tables
where table_schema='数据库名' and TABLE_NAME='表名称';
2、查看每个库中数据和索引占用大小
select TABLE_SCHEMA,
concat( round(DATA_LENGTH/1024/1024) , 'M' ) data_length,
concat( round(INDEX_LENGTH/1024/1024) , 'M' ) index_length
from information_schema.tables
GROUP BY table_schema;
3、查询整个mysql所有的数据大小
select concat(round(sum(DATA_LENGTH/1024/1024),2),'M') from information_schema.tables;