使用workbench在数据库中更新数据时报错: 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.sql:   update tableName set employee_detailed_status='xx', employee_status_code='xx' where employee_detailed_status='xx'

2.通过错误提示可以看出:  当前数据库使用的是 safe update mode(安全更新模式),并且在update时where 中没有把主键当做条件。因为在该模式会导致非主键条件下无法执行update或者delete命令,因此会报错。

3.如何解决这个问题呢?

第一种方法:

执行命令SET SQL_SAFE_UPDATES = 0 来修改下数据库模式,这样再去执行update语句或者delete语句即可成功。

参考地址: https://jingyan.baidu.com/article/6c67b1d6f0efca2787bb1eba.html

第二种方法:

  (1) 在workbench的菜单栏点击“edit-->Preferences”,然后会弹出对话框“workbench preferences”。

  

  (2) 在“workbench”左边栏点击“SQL Editor”,会看到最后一行是“Safe Updates……”是打钩的,我们只要缺消打钩即可。

       当缺消打钩之后,点击“OK”按钮,linux系统可能会出现“OK”按钮无法点击的情况,请在左边栏点击“General Editors”选项,这样就可以点击“OK”按钮了。

  

  (3) 当上面设置好之后,请重启workbench。

参考地址: https://jingyan.baidu.com/article/6c67b1d6f0efca2787bb1eba.html

更新数据库中数据时出现: 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. 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语句中正常. 异常内容: ...

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

    目录 #事故现场 #解决方法 #事故现场 mysql执行update操作报错: sql如下: update psmp.Users set name='Jack' where name='Lily'; ...

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

  7. Mysql Workbench 执行sql语句删除数据时提示error code 1175

    error code 1175是因为有安全模式限制 执行命令SET SQL_SAFE_UPDATES = 0;之后可以进行操作

  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. skeljs框架关键点使用

    global  全局 style.css    containers: 1400px;容器宽度 xlarge  超大屏(media: max-width:1680px) style-xlarge.cs ...

  2. Angular 组件之间的传值

    第一种方法(传单个或者多个参数): 主页面方法: 先添加引用:private _routes: Router, Details(PBSCode) { this._routes.navigate(['p ...

  3. Windows 下 IIS与Apache 共存

    在Windows服务器下, 安装了IIS以及Apache服务器, 如何使他们一起工作. 目前我面对的问题是, 只有一个IP地址,要通过不同的端口来访问不同的程序. 解决方案如下: 1.找到 Apach ...

  4. NGUI利用深度测试实现新手引导遮罩

    实现原理:实际上就是先利用渲染队列渲染,然后再利用ZTest,改变渲染的遮挡关系. PS:Depth Testing:深度测试,也叫深度缓冲.只有最靠近观察者的物体会被绘制.深度即Z,该值越小表示离观 ...

  5. ios开发介绍

    iOS开发概述 •什么是IOS •什么是IOS开发 •为什么要选择IOS开发 •学习IOS开发的准备   1.什么是iOS   •iOS是一款由苹果公司开发的操作系统(OS是Operating Sys ...

  6. 迅为IMX6Q四核核心板商业级|工业级|IMX6Plus版本|IMX6DL双核核心板

    IMX6Q处理器:兼容单核,双核,工业级,汽车级,IMX6Q最新Plus版本,共用同一底板,高端产品无忧. i.MX6系列针对消费电子.工业控制和汽车应用领域,它将ARM Cortex-A9架构的高功 ...

  7. 背景渐变 background-image:linear-gradient(0deg,#fff,#ccc);

    背景渐变 background-image:linear-gradient(0deg,#fff,#ccc);

  8. windows SDK创建一个窗体

    #include <windows.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, U ...

  9. 07JavaScript数组与字符串对象

    JavaScript数组与字符串对象 5.1.1数组(Array)对象 <script> //声明一个数组并赋值; var arr = new Array("aa",& ...

  10. 04C#运算符

    C#运算符 运算符分类 与C语言一样,如果按照运算符所作用的操作数个数来分,C#语言的运算符可以分为以下几种类型: l  一元运算符:一元运算符作用于一个操作数,例如:-X.++X.X--等. l  ...