ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (bj18
.booktest_characterinfo
, CONSTRAINT booktest_characterinfo_hbook_id_67c63e4a_fk_booktest_bookinfo_id
FOREIGN KEY (hbook_id
) REFERENCES booktest_bookinfo
(id
))
在mysql中插入对应字段的记录出现的问题。
输入语句:SET FOREIGN_KEY_CHECKS = 0。即可解决问题。
例如: