Cannot add or update a child row: a foreign key constraint fails (o2o.表一, CONSTRAINT fk_shop_profile FOREIGN KEY(owner_id) REFERENCES 表二(user_id))

也就是说表一中涉及到的外键是fk_shop_profile,
表一中的列owner_id和表二中的列user_id有外键关联,现在这里的数据插入出现了问题

解决:有外键关联,将关联删掉,再添加或更新数据

数据库添加或者更新数据报错:Cannot add or update a child row相关推荐

  1. 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 ...

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

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

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

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

  4. 关于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语句的正确 然后 ...

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

    问题内容: 在一个hibernate项目中,为一个Model类添加一个多对一的配置,在进行功能调试的时候报如下错误. Caused by: com.mysql.jdbc.exceptions.MySQ ...

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

    Cannot add or update a child row: a foreign key constraint fails (`o2o`.`tb_product_img`, CONSTRAINT ...

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

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

  8. 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图数据库转换的时候,转换规则涉及到外键,所以需要 ...

  9. java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key c

    错误原图: 错误分析:外键约束失败导致插入数据有误 解决问题:检查被关联的外键字段值,在原表中是否有对应的值,添加时外键的值在原表(外键关联的表)中一定要有该值,没有的值添加报错. 相关知识:外键约束 ...

最新文章

  1. android 更新 18个月,MIUI迎接史上最大更新:18个月内绝不卡顿,友商羡慕!
  2. mysql删除原则_MySQL数据库的增删选查
  3. 【Netty】NIO 选择器 ( Selector ) 通道 ( Channel ) 缓冲区 ( Buffer ) 网络通信案例
  4. c#泛型作为返回类型的写法
  5. 编写一个程序,要求输入一个ASCII码值(如66),然后输入相应的字符`
  6. #2009. 「SCOI2015」小凸玩密室
  7. 证明: 1/x = a^(-1)
  8. c语言技术课第一次作业
  9. Linux进程管理命令:nohup、、jobs、fg、bg、ps、kill
  10. flashplayer 10 的 p2p 基础
  11. java 200以内的素数_Java——200以内的质数
  12. 惠普打印机介质不匹配_HP打印机驱动安装失败的解决办法
  13. python(2): If/for/函数/try异常/调试/格式输出%
  14. 退出卸载360、QAX 天擎,无需密码
  15. 在ios10+的safair中实现视频的自动播放
  16. Java 应用程序,该程序中有 3 个类:Triangle、T rapezium 和 Circle,分别用来 表示三角形、梯形和圆形。
  17. Unity UGUI DoTween 学习笔记
  18. android qq自动发红包,Android实现QQ抢红包插件
  19. 50条狗中有多少条病狗?
  20. Swift [UInt8]转16进制字符串

热门文章

  1. HDU 4267-Phage War-线段树
  2. 线性代数学习之初等矩阵和矩阵的可逆性
  3. Python函数fuction③
  4. 双目相机标定以及立体测距原理及实现(上)
  5. 软文推广应该如何写好行业类软文
  6. python语言p语言_关于 Python 语句 P = –P,以下选项中描述正确的是________
  7. leetcode 5687. 执行乘法运算的最大分数
  8. 【AD封装】KF2EDGK系列5.08接线端子(带3D)
  9. 今日之坑-unity AssetDatabase.FindAssets和LoadAllAssetsAtPath使用
  10. PD建模不好用?快来试试PDMan吧