MySQL: How do I find out which tables reference a specific table?

前端 未结 7 1981
挽巷
挽巷 2021-01-31 08:21

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

7条回答
  •  野的像风
    2021-01-31 09:07

    select table_name 
    from information_schema.referential_constraints 
    where referenced_table_name = 'parent table here';
    

提交回复
热议问题