I want to drop a table but it is referenced by one or more other tables. How can I find out which tables are referencing this table without having to look at each of the tables in the database one by one?
select table_name from information_schema.KEY_COLUMN_USAGE where table_schema = 'my_database' and referenced_table_name = 'my_table_here';
This works.
1.4m articles
1.4m replys
5 comments
57.0k users