How do I see all foreign keys to a table or column?

后端 未结 13 823
忘了有多久
忘了有多久 2020-11-22 09:14

In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MyS

13条回答
  •  伪装坚强ぢ
    2020-11-22 09:31

    EDIT: As pointed out in the comments, this is not the correct answer to the OPs question, but it is useful to know this command. This question showed up in Google for what I was looking for, and figured I'd leave this answer for the others to find.

    SHOW CREATE TABLE ``;
    

    I found this answer here: MySQL : show constraints on tables command

    I needed this way because I wanted to see how the FK functioned, rather than just see if it existed or not.

提交回复
热议问题