select TABLE_NAME, concat(truncate(data_length/1024/1024,2),' MB') as data_size, -- 数据大小
concat(truncate(index_length/1024/1024,2),' MB') as index_size -- 索引大小
from information_schema.tables where TABLE_SCHEMA = 'xxx'
group by TABLE_NAME order by data_length desc;
select count(1) sum from xxx;