a foreign key constraint fails
今天遇到一个问题,一对一级联保存时,报错如下:
Cannot add or update a child row: a foreign key constraint fails
解决方法:
MySQL 的可视化工具里面的对应表的外键默认为不级联,改成级联之后就可以啦。
a foreign key constraint fails的更多相关文章
- MySQL主从复制中断,报“Error on master: message (format)='Cannot delete or update a parent row: a foreign key constraint fails' error code=1217” 错误
前几天,发现从库挂了,具体报错信息如下: 分析思路 1. 因为我采用的是选择性复制,只针对以下几个库进行复制: card,upay,deal,monitor,collect.所以,不太可能出现对于sa ...
- 【转】 #1451 - Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法
转载地址:http://blog.csdn.net/donglynn/article/details/17056099 错误 SQL 查询: DELETE FROM `zmax_lang` WHERE ...
- 【转】表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
转载地址:http://lijiejava.iteye.com/blog/790478 有两张表,结构如下: t_item: t_bid: id ...
- Hibernate级联删除时:Cannot delete or update a parent row: a foreign key constraint fails异常
在删除主表数据时,报了一个异常 Cannot delete or update a parent row: a foreign key constraint fails 原因是主表中还包含字表的数据, ...
- Error 'Cannot add or update a child row: a foreign key constraint fails故障解决
一大早的,某从库突然报出故障:SQL线程中断! 查看从库状态: mysql> show slave status\G Slave_IO_State: Waiting for master to ...
- MySQL:ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
MySQL在删除一张表时出现 ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fa ...
- insert时报Cannot add or update a child row: a foreign key constraint fails (`yanchangzichan`.`productstatusrecord`, CONSTRAINT `p_cu` FOREIGN KEY (`cid`) REFERENCES `customer` (`cid`))错误
mybatis在insert时报Cannot add or update a child row: a foreign key constraint fails (`yanchangzichan`.` ...
- IntegrityError at /admin/users/userprofile/add/ (1452, 'Cannot add or update a child row: a foreign key constraint fails (`mxonline`.`django_admin_log`, CONSTRAINT `django_admin_log_user_id_c564eba6_
报错现象 在执行 django 后台管理的时候添加数据导致 1452 错误 报错代码 IntegrityError at /admin/users/userprofile/add/ (1452, 'C ...
- ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails ()
centos7.5 删除表空间文件失败 问题: mysql> alter table country discard tablespace; ERROR 1451 (23000): Cannot ...
随机推荐
- MTK手机最低亮度值修改教程,有效降低亮度[转]
感谢halflover的教程 反编译framework-res.apk 打开\framework-res\res\values\integers.xml 然后找到 <integer name=& ...
- cf C. Matrix
http://codeforces.com/contest/365/problem/C 构造出的矩阵中的长方形的和等于构成它的长的那些数字的和加上构成它的宽的那些数字的和. 也就是求这个字符串中的两个 ...
- Window Ghosting(仍可拖动失去响应的窗口,因为我们真正的窗口已经让系统用Ghosting窗口替代了。使用IsHungAppWindow 探测)
最近工作中遇到Window Ghosting这个问题, 感觉挺有意思,这里简单记录下. 在XP时代我们的程序没有响应后只能通过任务管理器强制杀掉,但是Vista之后情况变了, 我们仍然可以拖动 ...
- hdu4085
http://acm.hdu.edu.cn/showproblem.php?pid=4085 斯坦纳树. 用状压DP. 一共有2K个关键点:1,2...,K和N-K+1,N-K+2...,N,我们用一 ...
- j2ee开源项目——IT学习者博客(itxxzblog v1.0)
大家好,我是IT学习者-螃蟹,已经有近一周的时间没有更新文章了,作为回报,今天起将更新一个大件,也就是螃蟹还在进行中的IT学习者博客. IT学习者博客的初期设计已经完成,功能也已经完成了大半,具备了当 ...
- java java.uitl.Random产生随机数
通过使用java.uitl.Random产生一个1-10内的随机数.例: Random random = new Random(); int i = Math.abs(random.nextInt() ...
- 转:DesiredCapabilities内容详解--Appium服务关键字
## Appium 服务关键字 <expand_table> |关键字|描述|实例| |----|-----------|-------| |`automationName`|你想使用的自 ...
- 5狐网教你从零基础做Firefox os 手机应用开发赚money
如果你还没有接触过web编程,这里有基础教程教你怎样一步一步学习开发,如果你已经是一个web编程基础的人,那你就很容易将web编程放到手机上,轻松教你移植web应用游戏到Firefox手机应用再发布到 ...
- jps命令使用
jps工具 jps(Java Virtual Machine Process Status Tool)是JDK 1.5提供的一个显示当前全部java进程pid的命令,简单有用,很适合在linux/un ...
- opencv 实现进度控制
进度控制: #include <opencv\cv.h> #include <opencv\highgui.h> #include <opencv\cxcore.h> ...