MySQL 获取数据库中的所有表名和列名

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/LOVE_HopeOne/article/details/84625970

sql语句在MySQL获取数据库里的所有表名:

select table_name from information_schema.tables where table_schema='数据库名'

sql语句在MySQL获取数据库表的所有列名:

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

猜你喜欢

转载自blog.csdn.net/LOVE_HopeOne/article/details/84625970