MySQL “Cannot add or update a child row: a foreign key constraint fails”
MySQL“无法添加或更新子行:外键约束失败”
意思就是本表的外键 在另一表中没有数据 需要先迁移数据
举例:
需要seller表中sellerId作为外键 对应到assert表中的sellerId主键
如图 先把数据都弄成一致
navicat+MySQL设置外键MySQL “Cannot add or update a child row: a foreign key constraint fails”
这样就可以再取设置外键就不会有MySQL “Cannot add or update a child row: a foreign key constraint fails”的错误了
navicat+MySQL设置外键MySQL “Cannot add or update a child row: a foreign key constraint fails”

相关文章:

  • 2022-12-23
  • 2021-11-10
  • 2021-10-01
  • 2022-12-23
  • 2021-06-06
  • 2021-06-07
猜你喜欢
  • 2022-01-10
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
相关资源
相似解决方案