You can use the INFORMATION_SCHEMA database and the COLUMNS table in particular Example of use:
Code:
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%'
say, you want to check a database called cheap_eyeglasses, here is your MySQL command:
Code:
SELECT
table_name,
column_name,
data_type,
ordinal_position
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = 'cheap_eyeglasses' --- the database you want to search
AND column_name = 'product_id' ; --- or: column_name LIKE '%name%'