mysql查询数据库储存数据的占用容量大小
可是使用mysql的information_schema数据库,储存的就是数据库元数据相关信息
- 查询指定数据库的容量大小,返回的单位是字节
select sum(DATA_LENGTH)
from information_schema.TABLES
where table_schema = '你的数据库'
- 查询指定数据表的大小,返回的单位是字节
select sum(DATA_LENGTH)
from information_schema.TABLES
where table_schema = '你的数据库'
and table_name = '你的数据表';