Mysql - 找出特定表存在哪個資料庫

Mysql - 找出特定表存在哪個資料庫

我該如何找出 MySql 中存在特定表的資料庫?

Mysql version is 
+----------------------+
| version()            |
+----------------------+
| 5.1.35-community-log | 
+----------------------+

由於我的實例上有大約 25 個資料庫,我只想查找特定表存在哪個資料庫?

答案1

mysql> select * from information_schema.tables where table_name='foo'\G

答案2

以下查詢將提供資料庫名稱。

select TABLE_SCHEMA from TABLES WHERE  TABLE_NAME like '%yourtablename%'\G;

相關內容