In MySQL Workbench, is it possible to search for a specific column name in all the tables?
(Writing the string to look for in the field at the top right does nothing).
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
SELECT table_name, column_name, data_type, ordinal_position FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'myDatabase' --- the database you want to search AND column_name = 'name' ; --- or: column_name LIKE '%name%'
To expand on @ypercube's answer (He gets a +1), if you do not know which database the table resides, do this:
SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM INFORMATION_SCHEMA.COLUMNS WHERE column_name = 'name' ; --- or: column_name LIKE '%name%'
In MySQL Workbench (v6.3) (Windows):
This shows a sortable grid of Table, Column, ...
Sadly the sort is not stable. So initially sorting by table, then column does not preserve table name ordering within a group of identical column names.
The grid is slow to open, but then it fast to find groups of columns.
It does not search across databases.