select column_name,column_comment,column_data_type
from information_schema.columns
wehre table_name='表名称' and table_schema='数据库名称'
---information_schema.columns数据库表信息
--查询主键
select column_name
from information_schema.'key_column_usage'
where table_name='表名称' and constraint_name='primary'