查询所有数据库

show databases;    #显示所有数据库名称

查询指定数据库所有表名

select table_name from information_schema.tables where table_schema='数据库名称' and table_type='base table';

查询指定表所有字段名

select column_name from information_schema.columns where table_schema='数据库名称' and table_name='表名'; 

查询指定表所有字段名和类型

select column_name,data_type from information_schema.columns where table_schema='数据库名称' and table_name='表名';