当我不想将两个表相互连接时,我收到消息:#1452 - 无法添加或更新子行:外键约束失败....我想从 facebook_users 表连接 oauth_uid2(主键)到带有外键 oauth_uid2 的 bugs 表。但我总是收到这个消息。我已经清除了我的数据,但没有任何效果。此外,在 users_facebook 表中,我有 1 条记录。
1452 - 无法添加或更新子行:外键约束失败 (
phples
.bugs
, CONSTRAINTbugs_ibfk_1
FOREIGN KEY (oauth_uid2
) REFERENCESusers_facebook
(oauth_uid2
) ON DELETE CASCADE ON UPDATE CASCADE)
错误表:FK = oauth_uid2, PK= bug_id
#Name Type Collation Attributes Null Default Extra Action
1 bug_id int(30) No None AUTO_INCREMENT Change Drop Browse distinct values Primary Unique Index Spatial Fulltext
2 bugtitle varchar(50) utf8_unicode_ci No None Change Drop Browse distinct values Primary Unique Index Spatial Fulltext
3 bugdescription varchar(500) utf8_unicode_ci No None Change Drop Browse distinct values Primary Unique Index Spatial Fulltext
4 oauth_uid2 int(30) No None Change Drop Browse distinct values Primary Unique Index Spatial Fulltext
users_facebook 表:PK= oauth_uid2
# Name Type Collation Attributes Null Default Extra Action
1 oauth_uid2 int(30) No None Change Drop Browse distinct values Primary Unique Index Spatial Fulltext
2 email varchar(70) utf8_unicode_ci No None Change Drop Browse distinct values Primary Unique Index Spatial Fulltext