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';
- 报错如下:
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的更多相关文章
- 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 ...
- 【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 ...
- 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 ...
- 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语句中正常. 异常内容: ...
- 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 ...
- 更新数据库中数据时出现: 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 ...
- 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 ...
- 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 ...
- 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使用.
随机推荐
- [校内训练19_09_02]C
题意 给出一棵N 个节点的树,树上的每个节点都有一个权值$a_i$. 有Q 次询问,每次在树上选中两个点u, v,考虑所有在简单路径u, v 上(包括u, v)的点构成的集合S. 求$\sum_{w∈ ...
- CF572_Div2_D2
题意 http://codeforces.com/contest/1189/problem/D2 思考 显然地,如果出现度数为2且两条出边边权不相同的情况,是无法构造合法方案的. 下面考虑缩边后的树, ...
- 分享一下我在mysql5.6+mysql8数据库安装过程中的一些坑!
Mysql5.6安装 下载好安装包后,在bin目录下用cmd打开,输入mysqld install [服务名]新建个服务 在windows+r输入services.msc即可查看服务 怎样使用mysq ...
- 2016 CCPC-Final-Wash(优先队列+贪心)
Wash Mr.Panda is about to engage in his favourite activity doing laundry! He’s brought ...
- PyCharm安装和使用教程(Windows系统)
说明: PyCharm 是一款功能强大的 Python 编辑器, 本文简单的介绍下PyCharm 在 Windows下是如何安装的. PyCharm 的下载地址:http://www.jetbrain ...
- Git 初级使用 windows & Ubuntu
目的:有一段代码要进行几个人同时维护,但是传来传去不方便,所以希望在github上实现,前提是每台机器都有git 在github 上新建一个项目 然后会看到,大体上就按这执行就可以 在Windows系 ...
- java.lang.NullPointerException at org.apache.jsp.**_jsp.jspInit(**_jsp.java)tomcat启动异常解决方法
今天遇到的其他一个问题就是,启动tomcat时,报:java.lang.NullPointerException at org.apache.jsp.**_jsp.jspInit(index_jsp. ...
- DBSync如何连接并同步MySQL
DBSync支持各种异构数据库之间的同步,如Access.SQL Server.Oracle.MySQL.DB2等,但很多用户在同步MySQL时遇到问题,这里讲述一下解决措施. 1.问题现象DBSyn ...
- [flask]邮件配置-20171227
环境变量配置: # PowerShell设置环境变量: $env:MAIL_USERNAME = "" $env:MAIL_PASSWORD = "" 国内: ...
- LwIP与IPv6
2.0.0中才开始支持IPv6,在此版本中改写了SNMP,但还没有IPv6的统计量.目前最新版本是2.0.2,其中SNMP也没有IPv6统计量(哪些?与IP的统计量有何区别?) 1.4.1中虽然有ip ...