select COLUMN_NAME,DATA_TYPE,COLUMN_COMMENT from information_schema.COLUMNS where table_name = '表名' and table_schema = '数据库名称';

得到结果:
查询mysql数据库中表的所有字段名

相关文章: