Navicat中新建查询
SELECT COLUMN_NAME 字段名称,
COLUMN_TYPE 数据类型,
IF(IS_NULLABLE='NO','是','否') AS '必填',
COLUMN_COMMENT 注释
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema ='数据库的名称'
AND table_name = '表的名称'
导出结果
最后可以在表格中替换下划线为空.
MySQL官方网址: https://dev.mysql.com/doc/refman/8.0/en/information-schema-columns-table.html