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

这是因为MySQL运行在safe-updates模式下,该模式会导致非主键条件下无法执行update或者delete命令。或者是更新时没有带条件导致的。

解决方式一:

1、show variables like 'sql_safe%';查看开关状态。

2、执行命令set sql_safe_updates=0;修改下数据库模式

解决方式二:

在更新的语句上加上条件,比如Where 1=1,或者id<>0

参考:

http://www.linuxidc.com/Linux/2015-09/123017.htm

https://www.cnblogs.com/xuancaoyy/p/5814658.html

原文地址:https://www.cnblogs.com/EasonJim/p/8030408.html