300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > [HY000][1822] Failed to add the foreign key constraint. Missing index for constraint ‘fk_com’

[HY000][1822] Failed to add the foreign key constraint. Missing index for constraint ‘fk_com’

时间:2022-12-11 12:22:17

相关推荐

[HY000][1822] Failed to add the foreign key constraint. Missing index for constraint ‘fk_com’

[HY000][1822] Failed to add the foreign key constraint. Missing index for constraint 'fk_comment_hnum'

mysql出现这个报错的时候一般是外键的问题。

检查这个外键连接的是不是另一个表的主键。

外键约束细节

1、从表里的外键通常为主表的主键

2、从表里外键的数据类型必须与主表中主键的数据类型一致

3、主表发生变化时应注意主表与从表的数据一致性问题

4、外键是用于两个表的数据之间建立连接,可以是一列或者多列,即一个表可以有一个或多个外键。

5、带有主键的那张表称为父表,含外键的是子表,必须先删除外键约束才能删除父表。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。