我已经试用过语法:如何在mysql中删除外键?
Alter Table bc DROP FOREIGN KEY STUD_ID;
这是给错误:无法DROP 'STUD_ID';检查列/键存在
Alter Table bc DROP CONSTRAINT STUD_ID;
这是给错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CONSTRAINT STUD_ID' at line 1
建议我的可能途径。
第一个查询就可以了。您的密钥可能与索引列不同。运行'show index from bc' –
嗨,我在第一个查询中看不到任何问题。你可以在这里上传你的餐桌吗? –
@juergend完成了。谢谢! – XYZ