Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I find out which Database a particular table is present in MySql ?

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

As I am having around 25 DB on an instance, I just want to find which database a particular table is present?

share|improve this question
up vote 3 down vote accepted
mysql> select * from information_schema.tables where table_name='foo'\G
share|improve this answer

Following query will provides the DB name.

select TABLE_SCHEMA from TABLES WHERE  TABLE_NAME like '%yourtablename%'\G;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.