mysql设置外键后向表中插入数据失败,提示1452 - Cannot add or update a child row: a foreign key constraint fails
navicat报[Err] 1452 - Cannot add or update a child row: a foreign key constraint fails (stores
.t_goods
, CONSTRAINT fk_t_goods_reference_t_suppli
FOREIGN KEY (Supp_code
) REFERENCES t_suppliers
(Supp_code
))
删除外键
在外键有的情况下可以增加数据
你有多个外键,对应表里都要有数据才行啊
你要先在两个外表里加数据,才可以在t_goods里增加数据