1

I have multiple databases in mysql server but want to search the location of a specific table .Can u help me in locating the databases that contain specific table.I am working in command mode. Thank You!

Vijay
  • 213
  • 1
  • 9

2 Answers2

1

Look up in COLUMNS table in information_schema database.

SELECT `TABLE_SCHEMA`, `TABLE_NAME` 
    from `COLUMNS` 
    WHERE 
        `COLUMN_NAME` = 'YOUR_COLUMN_NAME';

You need root privilege for this. or at least SELECT permission on Information_schema table.

Shiplu Mokaddim
  • 56,364
  • 17
  • 141
  • 187
0

Below link might help you...

How to find all the tables in MySQL with specific column names in them?

Please let me know incase of further queries...

Community
  • 1
  • 1
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
  • Thanks a lot! This link gave me the hint and I solved it as follows-> select table_schema from information_schema.tables where table_name='tablename'; – Vijay Jan 14 '12 at 08:40
  • Ahh I remember now... `select * from tables` gives all tables that are present in database... BUT was not sure of PATH.... – Fahim Parkar Jan 14 '12 at 08:46