#事故现场

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. c#数字图像处理(九)图像镜像

    private void mirror_Click(object sender, EventArgs e) { if (curBitmap!=null) { mirror mirForm = new ...

  2. 19_05_01校内训练[polygon]

    题意 把一个边长为1的正n边形放到一个正m边形中,要求m边形完全覆盖n边形,可以有交点,并且中心重合.求正m边形的最小边长,至少精确到6位.要求logn计算. 思考 先考虑m|n的情况. 我们知道,正 ...

  3. 释放innodb空间

    记一次MySQL运维 [root@b2btest ~]# free -h total used free shared buffers cached Mem: 125G 124G 780M 13M 2 ...

  4. Java并发读书笔记:JMM与重排序

    目录 Java内存模型(JMM) JMM抽象结构 重排序 源码->最终指令序列 编译器重排序 处理器重排序 数据依赖性 as-if-serial happens-before happens-b ...

  5. Notepad++ Plugin Manager更新插件出错

    作为墙内人士,更新个插件都TMD浪费很长时间! 解决方案: 定位文件notepaid++\updater\GUP.exe What is WinGup? --------------- WinGup ...

  6. Spring基础(一)_控制反转(IOC)

    Spring-IOC 1.简述 1.1 依赖注入DI 现实开发中,每一个应用都会由两个或多个类组成,这些类之间相互协作完成特定的业务逻辑.根据传统做法,每个对象负责管理与自己协作的对象的引用(也就是, ...

  7. BZOJ 2434 阿狸的打字机(ac自动机+dfs序+树状数组)

    题意 给你一些串,还有一些询问 问你第x个串在第y个串中出现了多少次 思路 对这些串建ac自动机 根据fail树的性质:若x节点是trie中root到t任意一个节点的fail树的祖先,那么x一定是y的 ...

  8. kendo ui 实现MVVM

    MVVM                    model----view model----model 实现页面和model之间的动态绑定 grid 支持 events  source  visib ...

  9. 根据navigator.userAgent返回值识别 浏览器

    function validBrowser(){ var u_agent = navigator.userAgent; var browser_name='Failed to identify the ...

  10. webpack chunkFilename 非入口文件的命名规则 [转]

    官网的文档只理解了filename是主入口的文件名,chunkFilename是非主入口的文件名 filename应该比较好理解,就是对应于entry里面生成出来的文件名.比如: { entry: { ...