#事故现场

mysql执行update操作报错:

  • sql如下:
update psmp.Users set name='Jack' where name='Lily';
  • 报错如下:

Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences

  • 分析

这是因为MySql运行在safe-updates模式下,该模式会导致非主键条件下无法执行update或者delete命令。

可以通过以下SQL进行状态查询:

show variables like 'SQL_SAFE_UPDATES';

#解决方法

  • 执行下面的sql,关闭safe-updates模式:
SET SQL_SAFE_UPDATES = 0;

SET SQL_SAFE_UPDATES = false;
  • 执行下面的sql,打开safe-updates模式:
SET SQL_SAFE_UPDATES = 1;

SET SQL_SAFE_UPDATES = true;

mysql 报错:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences的更多相关文章

  1. Mysql报错Error Code: 1175. You are using safe update

    使用MySQL执行update的时候报错:Error Code: 1175. You are using safe update mode and you tried to update a tabl ...

  2. 【MySQL笔记】解除输入的安全模式,Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconnect.

    Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE tha ...

  3. MySQL错误:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL easonjim

    错误: Error Code: . You are using safe update mode and you tried to update a table without a WHERE tha ...

  4. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries and reconn

    使用MySQL执行update的时候报错:   MySQL     在使用mysql执行update的时候,如果不是用主键当where语句,会报如下错误,使用主键用于where语句中正常. 异常内容: ...

  5. Mysql Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode

    今天用mysql workbench在更新数据的时候,出现了下面错误:15:52:39    update wp_posts set post_content = replace(post_conte ...

  6. 更新数据库中数据时出现: Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences 问题

    使用workbench在数据库中更新数据时报错: You are using safe update mode and you tried to update a table without a WH ...

  7. mysql更新字段值提示You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode

    1 引言 当更新字段缺少where语句时,mysql会提示一下错误代码: Error Code: 1175. You are using safe update mode and you tried ...

  8. rror Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnec

    在mysql5中,可以设置safe mode,比如在一个更新语句中 UPDATE table_name SET bDeleted=0; 执行时会错误,报: You are using safe upd ...

  9. Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and recon

    数据库默认模式是主键不可进行修改操作,所以需要运行以下语句. SET SQL_SAFE_UPDATES = 0;  -- 出现error1175使用.

随机推荐

  1. ios--->ios消息机制(NSNotification 和 NSNotificationCenter)

    问题的背景 IOS中委托模式和消息机制基本上开发中用到的比较多,一般最开始页面传值通过委托实现的比较多,类之间的传值用到的比较多,不过委托相对来说只能是一对一,比如说页面A跳转到页面B,页面的B的值改 ...

  2. 基准测试--->sysbench

    sysbench sysbench简介 sysbench是跨平台的基准测试工具,支持多线程,支持多种数据库:主要包括以下几种测试: cpu性能 磁盘io性能 调度程序性能 内存分配及传输速度 POSI ...

  3. linux 内存使用分析

      查看当前内存使用情况,最常用的指令就是 [root@t ~]# free -m total used free shared buffers cached Mem: -/+ buffers/cac ...

  4. 1755: N相关孪生素数

    #include<stdio.h>int f(int n,int L,int R){ int ch[10000],i,j,count=0; j=1; for(i=L;i<=R;i++ ...

  5. jenkins集成gitlab

     一.配置jenkins 1.安装Gitlab Hook Plugin )生成随机token 在系统中生成 openssl rand -hex 0f2a47c861133916d2e299e3 )创建 ...

  6. ros机器人之动作(二)

    前面我们实现了动作的定义,接下来实现动作的功能 实现一个基本的动作服务器 准备好所需的动作定义后就可以开始编写代码了.动作和话题一样,都是使用回调机制,即回调函数会在收到消息时被唤醒和调用. 例:si ...

  7. Java数据类型及对应取值范围

    Java数据类型及对应取值范围 在Java中,数据类型分为两大种:基本数据类型(值类型)和包装类型(引用数据类型).基本数据类型不是对象,不能调用toString().hashCode().getCl ...

  8. centos7中搭建ftp服务

    博客搬家: centos7中搭建ftp服务 最近想和同学共享一些文件资源,于是在实验室服务器上搭建个ftp服务,本博客记录一下配置的流程.过程基本是参照别人的方法来做的,博客也是在别人博客基础上修改的 ...

  9. The 2019 University of Jordan Collegiate Programming Contest

    链接:https://codeforc.es/gym/102267 A. Picky Eater 直接比较 int main(){ int x ,y; scanf("%d %d" ...

  10. centos7 手把手从零搭建深度学习环境 (以TensorFlow2.0为例)

    目录 一. 搭建一套自己的深度学习平台 二. 安装系统 三. 安装NVIDA组件 四. 安装深度学习框架 TensorFlow 五. 配置远程访问 六. 验收 七. 福利(救命稻草