关闭菜单
四少爷的blog
by Jermey
V 1.0
打开菜单

MYSQL获取数据库表结构

--获取所有数据库名:  
SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME NOT IN ('information_schema','mysql');

--获取某数据库的所有表:  
SELECT TABLE_NAME FROM information_schema.`TABLES` WHERE TABLE_SCHEMA = 'IMP' ORDER BY TABLE_NAME    

--取表结构  
SELECT * FROM information_schema.COLUMNS WHERE TABLE_NAME = 'BoardCount' 

(完)