美文网首页
Mysql报错记录

Mysql报错记录

作者: 抠脚大汗 | 来源:发表于2018-08-22 17:21 被阅读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

相关文章

网友评论

      本文标题:Mysql报错记录

      本文链接:https://www.haomeiwen.com/subject/cgmyiftx.html