简体   繁体   中英

#1452 - Cannot add or update a child row; foreign key restraint fails

I have tried to reference some of the previously asked Error #1452 questions asked here but I still cannot figure out what I am doing wrong. In my movies table, I want to make actor_id an FK that references the PK in the actor table. However I keep coming up with #1452 error. Where am I going wrong?

电影台

演员表

在此处输入图像描述

My guess would be that you already have some data in your database that are breaking the FK constraint (ie referencing id that does not exist).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM