MySQL给两个表添加外键时,报错

MySQL添加外键报错 - referencing column 'xx' and referenced column 'xx' in foreign key constraint 'xx' are incompatible

 

翻译意思是:外键约束“xx”中的引用列“xx”和引用列“xx”不兼容

说明两个表关联的列数据类型不一致,比如:varchar 与 int,或者 int无符号 与 int有符号,都不行,必须要一模一样才可以,修改完成后,就可以添加外键了。

 

相关文章:

  • 2021-05-04
  • 2022-12-23
  • 2021-07-22
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2022-01-04
相关资源
相似解决方案