统计表空间大小 select table_name,round(sum(data_length/1024/1024),2) as data from infomation_schema.tables where table_schema='dbname' GROUP BY table_name order by data desc;
导出数据字典
select
COLUMN_NAME 列名,
COLUMN_TYPE 数据类型,
DATA_TYPE 字段类型,
CHARACTER_MAXIMUM_LENGTH 长度,
IS_NULLABLE 是否为空,
COLUMN_DEFAULT 默认值,
COLUMN_COMMENT 备注
FROM
INFORMATION_SCHEMA.COLUMNS
where table_schema ='db'
and table_name = 'tableName';