查看某个数据下的表及其备注:
select table_name,table_comment from information_schema.tables where table_schema='db' ;
只要改后面的table_schema为你的数据库名
结果:
查看某个表下的字段及其备注
desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;
select COLUMN_NAME,COLUMN_COMMENT
from
INFORMATION_SCHEMA.Columns
where
table_name = '表名'
and table_schema='数据库名' INFORMATION_SCHEMA.Columns:
TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME, COLUMN_TYPE, COLUMN_KEY