mysql 表结构查询
一、通过 information_schema.tables表查询所有的相关表信息
SELECT table_name,table_type,engine,table_collation,
table_comment from information_schema.tables where table_schema ='database'
;
table_comment from information_schema.tables where table_schema ='database'
;
二、查询某一个表的所有字段信息
SELECT column_name,column_default,is_nullable,column_type,column_key,extra from information_schema.columns where table_schema = 'database' and table_name='table_name'