MySQL Workbench – How to Search All Columns in Every Table

mysql-workbench

In MySQL Workbench how do I search for a column which can be located in any schema. Basically I'm looking for a column called "notification" and I want to search all schemas for that column.

Look at this screenshot where I know for a fact there is a column named "activated_at" yet when I search for it after highlighting all my tables (using select all command also) it finds nothing. Why?

but if I run the following query its able to find the column, so why not with GUI?

    SELECT 
    table_schema,
    table_name, 
    column_name, 
    data_type,
    ordinal_position

FROM  INFORMATION_SCHEMA.COLUMNS 

WHERE column_name = 'activated_at' ; 

enter image description here

Best Answer

Open a new Query tab - from the File menu option choose the New Query item (second one down).

Then, it's exactly the same as in the MySQL tool.

use information_schema;
show tables;
SELECT * FROM columns;

will give the result:

Tables_in_information_schema
-----------------------------
CHARACTER_SETS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS                                <<--
COLUMN_PRIVILEGES
..
<more columns snipped>
..

For some reason, the information_schema database doesn't appear in the databases list in the GUI, but if you explicitly 'use' it, it will work.

Et voilĂ