use INFORMATION_SCHEMA;
select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME,
REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from KEY_COLUMN_USAGE where
REFERENCED_TABLE_NAME = 'your_table_name'
AND REFERENCED_COLUMN_NAME = 'your_column_name'
MySQL See all columns and tables that foreign key to a table or column
Disqus Comments Loading...