Can't Drop foreign key in MySQL

后端 未结 7 650
粉色の甜心
粉色の甜心 2020-12-04 19:37

I have had a 1 to many relationship between course and instructor, which I wanted to drop. When I tried to drop the instructorID in course table it told me that. I couldn\'t

7条回答
  •  甜味超标
    2020-12-04 20:16

    Please run an SHOW CREATE TABLE course; to make sure instructorID is the name of foreign key constraint.

    Additional: The error means MySQL searches for a foreign key constraint named "InstructorID" but there is no constraint with such name, maybe this is your column name, but you have to use the constraint name to delete foreign keys.

提交回复
热议问题