1. 查询所有表名
select table_name
from
information_schema.tables
where
table_schema='当前数据库'
2. 查看所有字段和字段注释
SELECT
COLUMN_NAME 字段,column_comment 中文,COLUMN_Type as 类型 ,column_key 主键,
IS_NULLABLE 可空,EXTRA 备注
FROM
INFORMATION_SCHEMA.COLUMNS
where
table_schema ='db-name' AND table_name = 'table-name';