在MySQL Workbench客户端执行delete和update命令时,总是会报“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.”这样的错误。解决办法如下:
方法1:在执行delete或update命令时,where子句的条件表达式中要包含主键列。但不适用无条件删除或更新情况。
方法2:执行set sql_safe_updates=0;修改数据库模式,仅在当前会话有效。若想在其它会话生效,可以执行set global sql_safe_updates=0;。
方法3:在Workbench中,从菜单Edit->Preferences->SQL Editor,把最下面的“Safe Updates”前面的勾去掉后重启即可。
解决MySQL Workbench删除数据时“Error Code: 1175. You are using safe update mode and you tried to update..“错误
最新推荐文章于 2025-02-12 17:32:17 发布