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 fails
可能是MySQL在InnoDB中设置了foreign key关联,造成无法更新或删除数据。可以通过设置FOREIGN_KEY_CHECKS变量来避免这种情况。
然后就可以删除表了。
删除完成后设置
MySQL:ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails的更多相关文章
- ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constraint fails
mysql 删除表时提示有外键 mysql> drop tables auth_group;ERROR 1217 (23000): Cannot delete or update a paren ...
- mysql ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails
ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails. 可能是MySQL在In ...
- 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 ...
- mysql 在删除数据出现Cannot delete or update a parent row: a foreign key constraint fails 这个该如何解决
mysql 在删除数据出现Cannot delete or update a parent row: a foreign key constraint fails 这个该如何解决 可以这样解决: S ...
- Mysql - 删除表时出现: 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 ...
- 【转】表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
转载地址:http://lijiejava.iteye.com/blog/790478 有两张表,结构如下: t_item: t_bid: id ...
- 表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理
有两张表,结构如下: t_item: t_bid: id int id int n ...
- 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 ...
- mysql删除有外链索引数据,Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法
mysql删除有外链索引数据Cannot delete or update a parent row: a foreign key constraint fails 问题的解决办法查询:DELETE ...
随机推荐
- java集合类深入分析之Queue篇(Q,DQ)
简介 Queue是一种很常见的数据结构类型,在java里面Queue是一个接口,它只是定义了一个基本的Queue应该有哪些功能规约.实际上有多个Queue的实现,有的是采用线性表实现,有的基于链表实现 ...
- InfluxDB 开源分布式时序、事件和指标数据库
InfluxDB 是一个开源分布式时序.事件和指标数据库.使用 Go 语言编写,无需外部依赖.其设计目标是实现分布式和水平伸缩扩展. 特点 schemaless(无结构),可以是任意数量的列 Scal ...
- java命令行运行main时jar及其配置
run.bat中的内容如: set mypath=%cd%/../set classpath=%mypath%\conf;%mypath%\lib\*start /b java -Xms64m -Xm ...
- SqLiter
1.去重 select * from daydata where wtid||rectime in (select wtid||rectime from daydata group by wtid| ...
- 《think in python》学习-8
字符串 字符串是一个序列,可以用方括号操作符来访问字符串中的单独字符 fruit = 'banana' letter = fruit[1] 方括号中的表达式称为下标 下标从0 开始 任何表达式,包括变 ...
- javascript设计模式——Observer
定义一种一对多的从属关系,当一个目标状态改变,所有他的从属对对象都将收到通知. 1.简单的Observer模式 实现 var Observer = function(){ this.list = [] ...
- js学习日记 (1)createDocumentFragment() ES6 => 箭头
只能说是会用和记载,深入理解还需时间. 有关性能优化: 使用createdocumentfragment()方法可以创建某个具有节点该有的所有属性的节点. 使用情况: 提取文档中的某个小部分,修改文 ...
- [Linked List]Remove Nth Node From End of List
Total Accepted: 84303 Total Submissions: 302714 Difficulty: Easy Given a linked list, remove the nth ...
- C++<algorithm>中sort的比较函数写法(转)
转自:http://www.wl566.com/biancheng/98907.html C++<algorithm>中sort的比较函数写法,有需要的朋友可以参考下. 定义排序函数: 方 ...
- VC ++ 后台消息模拟
HWND TO=; //TO=::FindWindow(_T("Chrome_RenderWidgetHostHWND"),NULL); TO=::FindWindow(_T ...