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

874
2021/2/8 9:27:31
栏目: 云计算
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

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

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

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

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

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

select table_name 

from information_schema.tables 

where table_schema='database_name' and table_type='base table';

辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: Linux下数据库索引优化技术是什么