查看某個數據下的表及其備注:
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