查询表的大小(mysql)

--所有表的大小

select concat(round(sum(DATA_LENGTH/1024/1024),2),'M')
from information_schema.tables where table_schema='数据库' AND table_name='表名'

--表+索引大小

select concat(round(((sum(DATA_LENGTH)+sum(INDEX_LENGTH))/1024/1024),2),'M') from information_schema.tables
where table_schema='数据库'

原文地址:https://www.cnblogs.com/xphdbky/p/7049142.html