Error Code: 1175 - MySQL错误提示

[已解决]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.

执行sql前先执行如下命令:

SET SQL_SAFE_UPDATES = 0;

或使用主键执行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]保存。