You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum

mysql 无法 update,执行update sql异常。

原因:16:13:36 update t_maintain_alarm set alarmTime=‘2019-10-24’ 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 reconnect. 0.000 sec

翻译:16:13:36更新t_maintain_alarm设置闹钟时间='2019-10-24’错误代码:1175。您正在使用安全更新模式,并试图更新一个没有使用键列禁用安全模式的表,在首选项中切换选项—> SQL编辑器并重新连接。0.000秒

You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum
原因是在安全模式下只能通过 where 主键来修改。如果需要update,需要解除非安全模式。
#解除安全模式
SET SQL_SAFE_UPDATES = 0;

#安全模式
SET SQL_SAFE_UPDATES = 1;

You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum
SET SQL_SAFE_UPDATES = 0; 执行后在执行 update 语句就可以修改了。
需要需要改回安全模式就执行 SET SQL_SAFE_UPDATES = 1; 即可。

工具:MySql WorkBench 一般默认为安全模式
Navicat 一般默认为非安全模式。