您的位置:宽带测速网 > 网络知识 > mysql怎么查询表中的数据库名

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

2025-06-17 10:14来源:互联网 [ ]

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

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

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

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

selecttable_name

frominformation_schema.tables

wheretable_schema='database_name'andtable_type='basetable';