USEinformation_schema;--切记这里不能忘掉SELECTT.TABLE_SCHEMAAS'数据库名称',T.TABLE_NAMEAS'表名',T.TABLE_TYPEAS'表类型',...
USE information_schema; --切记这里不能忘掉SELECTT.TABLE_SCHEMA AS '数据库名称', T.TABLE_NAME AS '表名', T.TABLE_TYPE AS '表类型', T. ENGINE AS '数据库引擎', C.ORDINAL_POSITION AS '字段编号', C.COLUMN_NAME AS '字段名', C.COLUMN_TYPE AS '数据类型', C.IS_NULLABLE AS '允许为空', C.COLUMN_KEY AS '键类型', C.EXTRA AS '自增属性', C.CHARACTER_SET_NAME AS '编码名称', C.COLUMN_COMMENT AS '字段说明'FROMCOLUMNS CINNER JOIN TABLES T ON C.TABLE_SCHEMA = T.TABLE_SCHEMAAND C.TABLE_NAME = T.TABLE_NAMEWHERE T.TABLE_SCHEMA = 'mysql' --这里mysql指代的是库的名称,也可以在后面添加排序条件这里
全文详见:http://xpxw.com/?id=109