DELETE all where MySQL foreign key constraint does not fail

后端 未结 2 1179
独厮守ぢ
独厮守ぢ 2021-02-19 11:16

I am trying to delete a few records but am getting the following error:

Cannot delete or update a parent row: a foreign key constraint fails

2条回答
  •  离开以前
    2021-02-19 11:35

    Use ignore:

    DELETE IGNORE ...
    

    http://dev.mysql.com/doc/refman/5.0/en/delete.html

提交回复
热议问题