Mysql报错记录

2018-08-22  本文已影响0人  抠脚大汗

环境:当在执行delete操作

报错信息
17:12:41 delete from userinfo where age = '123456' 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.00060 sec

在使用mysql执行update的时候,如果不是用主键当where语句,会报如下错误,使用主键用于where语句中正常。这是因为MySql运行在safe-updates模式下的缘故--引自百度经验

知道原因了,处理起来就比较简单了,将safe_updates模式置为0;

set sql_safe_updates = 0;

再执行delete操作,OK

上一篇 下一篇

猜你喜欢

热点阅读