- 查看所有表表名和备注
SELECT TABLE_NAME,
table_comment
FROM `information_schema`.tables
WHERE table_schema='数据库名'
- 查询某张表的字段和备注
select column_name,
column_comment
from information_schema.columns
where table_name ='表名'
and table_schema='数据库名'
- 查看所有字段名称和备注
SELECT a.table_name,
a.column_name,
a.column_comment
FROM information_schema.columns a,
`information_schema`.tables b
WHERE a.table_name = b.table_name
AND a.table_schema = b.table_schema
AND a.table_schema='数据库名'
ORDER BY a.table_name,
a.ordinal_position;