查詢 MySQL 例項上所有資料庫

2021-10-01 13:28:56 字數 557 閱讀 3680

除錯環境:centos 7.6

安裝版本:mysql community server (5.6.43)

除錯人員:成長的小豬 jason song

通過以下方法我們可以查詢到當前例項中所有的資料庫列表

第一種通過 show 命令查詢(方式一)

show databases;
第二種通過 show 命令查詢(方式二)

show schemas;
第三種通過 sql 語句查詢

select schema_name 

from information_schema.schemata;

以下就是通過上面的方法查詢到的結果

操作MySQL資料庫查詢所有資料

coding utf 8 time 2020 8 7 22 01 author bingl email 15736980819 163.com file 操作mysql資料庫查詢所有資料.py software pycharm desc 靜,是一種修養。匯入pymysql import pymysq...

SQL Server 查詢資料庫中所有資料庫名錶名

1.查詢資料庫中的所有資料庫名 select name from master sysdatabases order by name 2.查詢某個資料庫中所有的表名 select name from sysobjects where xtype u order by name xtype u 表示所...

sql 查詢所有資料庫 表 字段

sql server 用master資料庫查詢所有的資料庫 use master select name from sysdatabases 用其中的乙個資料庫查詢所有表 use student select id name from sysobjects where type u 根據id查詢某個...