mysql> SET FOREIGN_KEY_CHECKS = 0;
Query OK, 0 rows affected (0.02 sec)
 
mysql> delete from repositories where repo_name = "watch/sinawatch_agent_update";
Query OK, 1 row affected (0.02 sec)
 
mysql> SET FOREIGN_KEY_CHECKS = 1;
Query OK, 0 rows affected (0.00 sec)
 
 
 

SET FOREIGN_KEY_CHECKS = 0 //关闭外键约束

进行完操作后别忘记了再把外键约束重新打开以下是打开数据库的外键约束:

SET  FOREIGN_KEY_CHECKS = 1 //打开外键约束

关于mysql中[Err] 1451 -Cannot delete or update a parent row: a foreign key constraint fails的更多相关文章

  1. 【转】 #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 ...

  2. Mysql之1451 - Cannot delete or update a parent row: a foreign key constraint fails...解决办法记录

    今天使用delete语句删除一张表中的一条信息时,提示了这么一个错误:1451 - Cannot delete or update a parent row: a foreign key constr ...

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

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

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

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

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

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

  9. 【转】表删除时 Cannot delete or update a parent row: a foreign key constraint fails 异常处理

    转载地址:http://lijiejava.iteye.com/blog/790478 有两张表,结构如下: t_item:                          t_bid: id    ...

随机推荐

  1. leetcode38

    public class Solution { public string CountAndSay(int n) { //1 //11 //21 //1211 //111221 //312211 // ...

  2. Fundamentals of Garbage Collection

    [Fundamentals of Garbage Collection] 1.Reclaims objects that are no longer being used, clears their ...

  3. 39. Combination Sum (Back-Track)

    Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C wher ...

  4. 13.Roman to Integer (HashTable)

    Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 t ...

  5. Spring Boot 响应jsp

    添加依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http:/ ...

  6. Docker RestApi Create mysql Container

    docker 提供了创建容器的rest api http://192.168.150.6:8888/containers/create?name=demo-mysql docker mysql容器的参 ...

  7. git忽略某个文件夹

    data/cache/* !data/cache/index.html !data/cache/smiOAuthToken.php

  8. Android Service 通知Activity更新界面的方法研究

    Android Service 通知Activity更新界面的方法研究   Android的最重要的组件式service和activity,那么在使用的过程中,我们最常遇到的问题是他们之间的通信问题. ...

  9. golang C相互调用带参数

    test.h #ifndef __TEST_H__ #define __TEST_H__ void SetFunc(char* str); extern void InternalFunc(char* ...

  10. UVaLive 4043 Ants (最佳完美匹配)

    题意:给定 n 个只蚂蚁和 n 棵树的坐标,问怎么匹配使得每个蚂蚁到树的连线不相交. 析:可以把蚂蚁和树分别看成是两类,那么就是一个完全匹配就好,但是要他们的连线不相交,那么就得考虑,最佳完美匹配是可 ...