利用information_schema数据库来获取数据库下所有表名以及字段名
select table_name,column_name from information_schema.columns where table_schema='数据库'
也可以指定表名
select table_name,column_name from information_schema.columns where table_schema='数据库名称' and table_name ='表名';
获取数据库中所有的表名
select table_name from information_schema.tables where table_schema='数据库名'