1
2
3
4
5
6
7
8
--获取所有数据库名:  
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'

(完)