mysql 生成数据字典
SELECT a.TABLE_NAME AS '表名', b.TABLE_COMMENT AS '表备注', a.COLUMN_NAME AS '字段名', a.COLUMN_TYPE AS '数据类型', a.IS_NULLABLE AS '是否可空', IF ( a.COLUMN_DEFAULT = '', '空字符串', IFNULL( a.COLUMN_DEFAULT, '无' ) ) AS '默认值', a.COLUMN_COMMENT AS '字段备注' FROM information_schema.COLUMNS AS a JOIN information_schema.TABLES AS b ON a.TABLE_SCHEMA = b.TABLE_SCHEMA AND a.TABLE_NAME = b.TABLE_NAME WHERE a.TABLE_SCHEMA = 'Database_Name' # 这里修改为数据库名 # 单表时加上下方条件 # AND a.TABLE_NAME = 'Table_Name' # 这里修改为表名 ———————————————— 版权声明:本文为CSDN博主「至天」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/maxsky/article/details/85131950