Cannot add or update a child row: a foreign key constraint fails (`o2o`.`tb_product_img`, CONSTRAINT `fk_product_img_product` FOREIGN KEY (`product_id`) REFERENCES `tb_product` (`product_id`))

外键不匹配,去查找插入的外键,和对应的外键的表是否有这个值。

SQL 错误 Cannot add or update a child row: a foreign key constraint fails (`o2o`.`tb_product_img`, CON相关推荐

  1. JPA 数据库添加数据报错:Cannot add or update a child row: a foreign key constraint fails

    最近写jpa 的单项多对多,出现的错误,记录一下 java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a c ...

  2. 关于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..... 首先确定sql语句的正确 然后 ...

  3. Cannot add or update a child row: a foreign key constraint fails都有哪些原因

    文章目录 前言 可能原因 1. 外键字段的数据类型 不匹配 2. 外键对应的表没有相应的数据 转载请标明出处: https://bigmaning.blog.csdn.net/article/deta ...

  4. Mysql添加数据时失败 Cannot add or update a child row: a foreign key constraint fails

    报错: Cannot add or update a child row: a foreign key constraint fails (`zy_test`.`order_item`, CONSTR ...

  5. mysql 1452 Cannot add or update a child row: a foreign key constraint fails

    文章目录 1. 出现报错 2. 解决方案 3. 追溯原因 3.1 简单的原因 3.2 棘手的原因 1. 出现报错 在进行mysq关系l数据库到neo4j图数据库转换的时候,转换规则涉及到外键,所以需要 ...

  6. 解决 mysql 插入数据报错: Cannot add or update a child row: a foreign key constraint fails

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 场景:我的情况是主表为用户 user 表,从表为职位 job 表,其中 job 表有一个外键为 us ...

  7. Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 怎么办?

    删除要成为外键的列. 再次创建它 尝试再次将其设置为外键.

  8. Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法

    报错的原因大概分为三种: 原因一: 添加的外键列与另一个表的唯一索引列(一般是主键)的数据类型不同 原因二: 要添加外键的表类型与另一个表的存储引擎是不是都为innodb引擎 #查看表引擎 法一: s ...

  9. Cannot add or update a child row: a foreign key constraint fails

    这是我在对主表的数据修改完后,在附属表建立数据时弹出的错误,很明显是在外键的设置上出现了问题. 一般来说,类型之类的一开始应该就是一样的,不然建表的时候就报错了,那么会有以下几种可能: 类型对但是创建 ...

最新文章

  1. pandas使用date_range函数生成日期序列数据、pandas将两个日期序列数据作差生成新的日期差数据列(8 days)、并提取天数数值(8)
  2. php set error handler,php的set_error_handler正确用法
  3. 教你学会七种维护服务器安全最佳技巧
  4. [有奖励]GeneralUpdate开源项目招募开发者
  5. python读取html文件中的表格数据_使用解析html表pd.read_html文件其中单元格本身包含完整表...
  6. 转载:.NET Memory Leak: XmlSerializing your way to a Memory Leak
  7. 【CF 543D】Road Improvement,树形DP
  8. Facebook 为安卓用户推出精简版 Messenger Lite,率先面向发展中国家
  9. 【数学基础】机器学习与深度学习中的数学知识
  10. 用ubantu14.04登录吉大校园网
  11. 一元二次方程组的简单解法
  12. 大数据就业方向_学大数据就业前景如何,就业方向有哪些?
  13. BUG生命周期和管理
  14. C/C++开3次方函数cbrt
  15. 【大学生数学建模竞赛时间一览表】
  16. 卡方检验——离散型特征相关性分析
  17. 入门 | 我们常听说的置信区间与置信度到底是什么?
  18. python空气质量分析与预测_干货!如何用 Python+KNN 算法实现城市空气质量分析与预测?...
  19. Uncaught Error: Undefined constant “Ford“
  20. 原型模式【浅克隆实现,使用序列化实现深克隆】Java代码演示

热门文章

  1. 经典网页设计:顶尖的个人作品集网站设计欣赏【上篇】
  2. 怎么打开计算机开机启动菜单,开机启动项怎么设置
  3. 【Java牛客刷题第四期】——想让自己算法大幅度提升,这一期你一定不要错过
  4. 数仓工具—Hive进阶之谓词下推(12)
  5. 笨兔兔的故事——带你了解Ubuntu,了解Linux 第十章 人才
  6. 课件属于计算机应用中的什么,ppt课件-《计算机应用基础》课件.ppt
  7. CSS动画萤火虫网页代码
  8. crawlspider解析,并使用crawlspider爬取八一中文网小说
  9. html中英文字母占几个px,CSS中解决英文字母、数字过长或者文本撑开网页
  10. 【Tips】OmniFocus 3 (3.1.1) 许可证