mysql怎么查询表中的数据库名

lewis 2018-12-03 24次阅读

mysql查询表中的数据库名的语法:“show databases”;

mysql查询表中的数据库名的方法:

1.查询所有数据库,sql语句为:“show databases;”

2.查询指定数据库中所有表名,sql语句为:

selecttable_name

frominformation_schema.tables

wheretable_schema='database_name'andtable_type='basetable';



发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。