Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql - find a table in all database

Tags:

Is there any command that I can locate a certain table from all databases? Since I forgot where the table is. Thanks.

like image 770
Stan Avatar asked Sep 21 '10 01:09

Stan


People also ask

How do I find a specific table in MySQL?

Find data across a MySQL connection by using the text search feature on any number of tables and schemas. From the schema tree, select the tables, schemas, or both to search and then right-click the highlighted items and click Search Data Table from the context menu.

Is the correct syntax for showing all tables in the database of MySQL?

Which among the following is the correct syntax for showing all tables in the database? Explanation: None.

How do I find a column in all tables in MySQL?

How to list all tables that contain a specific column name in MySQL? You want to look for tables using the name of columns in them. SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA. COLUMNS WHERE COLUMN_NAME IN('column1', 'column2') AND TABLE_SCHEMA = 'schema_name';


1 Answers

Use the MySQL specific:

SHOW TABLES

...or use the ANSI standard, INFORMATION_SCHEMA.TABLES:

SELECT table_name,
       table_schema AS dbname
  FROM INFORMATION_SCHEMA.TABLES
  WHERE table_name='searched table name'
like image 181
OMG Ponies Avatar answered Sep 20 '22 01:09

OMG Ponies