首页 > 技术文章 > mysql delete数据时报Error Code 1175

alice626 2016-02-03 17:35 原文

我们在学校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 Editor and reconnect.    0.000 sec

第一次遇到这个错误是正常的,这是因为mysql的安全机制造成的,以下是解决方案:

 

一 :选择mysql上面的Edit菜单

 

 

二:选择Edit菜单中的Preferences选项,选中SQL Editor,出现以下界面:

三:去掉safe Updates前面的选择框

四:重新连接database,然后执行sql就可以删除了

 

 

注意事项:

一般还是使用SET SQL_SAFE_UPDATES = 0;每次我们想删除数据或者更新数据时使用一下。

更改了设置后,以后删除更新数据时就不会有 什么提示了,一不小心我们删除了就不好了。

推荐阅读