mysql添加外键失败:sql 1452 Cannot add or update a child row:a foreign key constraint fails

做数据库作业时,我对已存在的两个表中的一个表添加另一个表的主键为外键,遇到以下错误: sql 1452 Cannot add or update a child row:a foreign key constraint fails的错误。 关联的两个表的字段分别如下:(即在score01表中添加courseno为关于course01表的外键约束) 原因:设置的外键和对应的另一个表的主键值不匹配。
相关文章
相关标签/搜索