MySQL UPDATE Error Code: 1175

MySQL Workbench执行UPDATE、DELETE返回Error Code: 1175. You are using safe update mode and you tried to update...错误。

通用的解决方案

在执行SQL语句前先执行:

SET SQL_SAFE_UPDATES = 0;

或者

通过id进行DML操作

或者

针对MySQL Workbench进行设置

MySQL Workbench 6.0 CE

菜单栏

Edit>Preferences>

点击SQL Queries,在General选项栏内勾选上第二项["Safe Updates".forbid UPDATEs and DELETEs with no key in Where clause or no LIMIT clause .Requires a reconnection.]

点击[ok]保存

MySQL Workbench 8.0 CE

菜单栏

Edit >Preferences>

点击SQL Editor,右侧选项栏下拉到末尾,把最后一个勾选上[Safe Update(rejects UPDATEs and DELETEs with no restrictions)]

最后点击[ok]保存