mysql更新字段值提示You are using safe update mode and you tried to update a table without a WHERE that uses

Posted unionline

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql更新字段值提示You are using safe update mode and you tried to update a table without a WHERE that uses相关的知识,希望对你有一定的参考价值。

1 引言

当更新字段缺少where语句时,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 Queries and reconnect. 0.000 sec

2 方案

SET SQL_SAFE_UPDATES = 0;
update 表名 set 字段1 = 字段2+1;
SET SQL_SAFE_UPDATES = 1;

3 总结

这篇文章仅作为记录使用。  

以上是关于mysql更新字段值提示You are using safe update mode and you tried to update a table without a WHERE that uses的主要内容,如果未能解决你的问题,请参考以下文章

MySQL: You are using safe update mode and you tried to update a table without a WHERE that uses a KE

SQL更新语句,Error Code: 1175. You are using safe update(在进行视图更新的时候遇到)

mysql 报错:Error Code: 1175. You are using safe update mode and you tried to update a table without a

Android studio提示Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.(代码片

Android studio提示Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.(代码片

Error Code: 1175. You are using safe update