https://www.cnblogs.com/kccdzz/p/9168500.html
https://blog.csdn.net/qq_35275233/article/details/81146305
查看某个数据库下每张表的数据量大小
use information_schema;
select table_name,table_rows from tables where TABLE_SCHEMA = '数据库名字' order by table_rows desc;
select
table_schema as '数据库',
sum(table_rows) as '记录数',
sum(truncate(data_length/1024/1024, 2)) as '数据容量(MB)',
sum(truncate(index_length/1024/1024, 2)) as '索引容量(MB)'
from information_schema.tables
where table_schema='XXX';