mysql workbench 关闭安全更新模式
使用Mysql workben时候执行update,select,例如下列代码时候,
update student set Sage=0;
update student set age=age+1;
常常出现错误
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.
但是使用命令行又一切正常。
这是由于MySQL Workbench打开了安全更新模式。解决方法就是关闭安全更新模式。
解决方法1:
SET SQL_SAFE_UPDATES = 0;
解决方法二:
1.点击edit->preferences 或者如下图右上角的按钮

2

本文介绍在使用MySQLWorkbench时如何解决因安全更新模式导致的更新操作失败问题。通过两种方法,一是临时禁用安全更新模式,二是永久更改设置,确保更新操作顺利进行。
2493

被折叠的 条评论
为什么被折叠?



