Wetts's blog

Stay Hungry, Stay Foolish.

0%

MySQL-元数据(information_schema库)

1
2
3
4
5
6
7
use information_schema;

select concat(round(data_length/1024/1024,2),'MB') as data_length_MB,
concat(round(index_length/1024/1024,2),'MB') as index_length_MB
from tables where
table_schema='<数据库名>'
and table_name = '<表名>';