#事故现场

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. 使用Rclone和WinFsp挂载FTP为磁盘

    介绍 Rclone:是一款的命令行工具,支持在不同对象存储.网盘间同步.上传.下载数据.官网网址:rclone.org WinFsp:是一款Windows平台下的文件系统代理软件(Windows Fi ...

  2. .Net Core建站(1):EF Core+CodeFirst数据库生成

    emmm,本来想着用Core做一个小项目玩玩的,然后肯定是要用到数据库的, 然后想,啊,要不用CodeFirst,感觉很腻害的样子,于是,一脸天真无邪的我就踏入了一个深不见底的天坑... 本来想着,应 ...

  3. 【自制操作系统06】终于开始用 C 语言了,第一行内核代码!

    一.整理下到目前为止的流程图 写到这,终于才把一些苦力活都干完了,也终于到了我们的内核代码部分,也终于开始第一次用 c 语言写代码了!为了这个阶段性的胜利,以及更好地进入内核部分,下图贴一张到目前为止 ...

  4. CSS-05-伪类及伪元素选择器

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  5. Shell之信号捕获

    前言 当我们在运行某一段代码的时候,希望有类似事物一样的操作,要么成功,要么失败:一般的shell脚本都是自上而下,从左之后运行,碰到异常信号就会出错,从而终止脚本的运行,这个时候脚本可能运行到某一处 ...

  6. 深入了解Zookeeper

    ZooKeeper是一个分布式的,开放源码的分布式应用程序协调服务,它包含一个简单的原语集,分布式应用程序可以基于它实现同步服务,配置维护和命名服务等.Zookeeper是hadoop的一个子项目,其 ...

  7. java线程池及创建多少线程合适

    java线程池 1.以下是ThreadPoolExecutor参数完备构造方法: public ThreadPoolExecutor(int corePoolSize,int maximumPoolS ...

  8. 小米重新上锁[BL]

    解锁一时爽,bug火葬场.废话不多说,直接上教程. 首先安装 线刷工具:http://bigota.d.miui.com/tools/MiFlash2018-5-28-0.zip 解锁工具:http: ...

  9. PyCharm2019.3.3专业版完美激活

    在 PYPL 编程语言榜单上,Python 因近几年受欢迎程不断提高而继续霸榜.俗话说“萝卜青菜,各有所爱”,在众多的编辑器当中,因每个人的使用习惯不同,也会选择各自的喜欢的编辑器.Pycharm 分 ...

  10. JAVA&&JAVA WEB开发包U盘封装版

    难以忍受机房的开发环境,就简单实现了将所有的开发文件封装进了U盘. 基于wmic的强大功能,实现了机房变态环境下的设置环境变量OS不用重新启动OS! install.bat @echo off mod ...