前言
如果你不想使用PDMan的话,这不失为一个好的方法
内容
导出某一个库
SELECT TABLE_SCHEMA as '数据库名称', TABLE_NAME as '表名称', COLUMN_NAME as '列名', COLUMN_TYPE as '数据类型', IS_NULLABLE as '允许为空', EXTRA AS 'PK', COLUMN_DEFAULT as '默认值', COLUMN_COMMENT as '备注' FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'database_name';
导出指定表
SELECT TABLE_SCHEMA as '数据库名称', TABLE_NAME as '表名称', COLUMN_NAME as '列名', COLUMN_TYPE as '数据类型', IS_NULLABLE as '允许为空', EXTRA AS 'PK', COLUMN_DEFAULT as '默认值', COLUMN_COMMENT as '备注' FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'database_name' and TABLE_NAME = 'table_name';
学无止境,谦卑而行.