问题描述:
报错如下:
ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint
提示有外键约束,不能删除父表记录,然而父表记录对应的子表中并没有相关记录

解决方式:
SET FOREIGN_KEY_CHECKS=0;
delete from account where id=22687 and name like '%xxxx%';
SET FOREIGN_KEY_CHECKS=1;

mysql ERROR 1451 (23000)的更多相关文章

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

  2. ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'

    use mysql mysql> select host, user from user; 将相应用户数据表中的host字段改成'%': update user set host='%' whe ...

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

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

  5. MYSQL ERROR CODE 错误编号的意义

    mysql error code(备忘) 转1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件 ...

  6. MySQL Error Handling in Stored Procedures 2

    Summary: this tutorial shows you how to use MySQL handler to handle exceptions or errors encountered ...

  7. ERROR 1062 (23000): Duplicate entry '0' for key 'PRIMARY'

    OS: centos 6.3DB: 5.5.14 测试创建yoon测试表,没有主键,没有索引,基础数据内容如下: mysql> select * from yoon;+----+-------- ...

  8. MySQL Error Handling in Stored Procedures---转载

    This tutorial shows you how to use MySQL handler to handle exceptions or errors encountered in store ...

  9. RDS 在线DDL诡异报错ERROR 1062 (23000): Duplicate entry

    RDS上执行报错如下: MySQL [ad_billing]> ALTER TABLE ad_spending ADD COLUMN impr bigint(20) NOT NULL DEFAU ...

随机推荐

  1. Linux NGINX部署

    一.Nginx简介 Nginx是一个web服务器也可以用来做负载均衡及反向代理使用,目前使用最多的就是负载均衡,具体简介我就不介绍了百度一下有很多,下面直接进入安装步骤 二.Nginx安装 1.下载N ...

  2. angluar1+ionic详情页返回在原来的位置(缓存数据和页面高度)

    因为是老项目,近期开发遇到了个需求就是从详情页按返回按钮要求返回到原来列表的页面位置,刚开始准备用的cache:true,但是存在大大的问题就是新增和编辑后返回数据都不是最新的,无法重新刷新页面rel ...

  3. superset在 centos 7安装运行

    参考:1.http://blog.csdn.net/u014729236/article/details/76302888?locationNum=2&fps=1 2.https://www. ...

  4. 使用autohotkey修改方向键、回车和启动程序

    具体步骤 下载并安装autohotkey. 在你觉得合适的地方鼠标右键-新建-autohotkey script(脚本):或者创建一个别的文件,再把后缀改成ahk也可以 一个新建的ahk文档里面会有这 ...

  5. html转化为图片下载

    业务需求:按照客户要求把排课表转化为图片下载到本地.一个月到排课有很多.所以图片会很大 <!DOCTYPE html> <html lang="en"> & ...

  6. html页面的CSS、DIV命名规则(仅供参考学习)

    CSS命名规则: 头:header 内容:content/containe 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中: ...

  7. java_25.1字节转为字符OutputStreamWriter

    public class Demo { public static void main(String[] args){ try { FileOutputStream fos = new FileOut ...

  8. 切面编程AOP之KingAOP

    1. 在Nuget上安装KingAOP 2. 创建一个新的类 public class Test : IDynamicMetaObjectProvider { public DynamicMetaOb ...

  9. abap 常用TCODE

    ABAP: 通过查询表TSTC或者TSTCT:SAP系统将所有的事务代码都存储在这个表中,包括字开发的Y*和Z* TCODE 事务代码功能描述 CG3Y 下载服务器上文件 CG3Z upload fi ...

  10. .net core中的分布式缓存和负载均衡

    通过减少生成内容所需的工作,缓存可以显著提高应用的性能和可伸缩性,缓存对不经常更改的数据效果最佳,缓存生成的数据副本的返回速度可以比从原始源返回更快.ASP.NET Core 支持多种不同的缓存,最简 ...