MySQL - Cannot add or update a child row: a foreign key constraint fails

后端 未结 9 735
执念已碎
执念已碎 2021-01-07 19:25

This seems to be a common error, but for the life of me I can\'t figure this out.

I have a set of InnoDB user tables in MySQL that are tied together via foreign key;

9条回答
  •  长情又很酷
    2021-01-07 20:17

    I had faced same issue while creating foreign constraints on table. the simple way of coming out of this issue are first take backup of your parent and child table then truncate child table and again try to make a relation. hope this will solve the problem.

提交回复
热议问题