码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-02-03 16:22:29      阅读:395      评论:0      收藏:0      [点我收藏+]

标签:you   key   error   option   col   nec   post   错误代码   mys   

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 a KEY column To disable safe mode

标签:you   key   error   option   col   nec   post   错误代码   mys   

原文地址:https://www.cnblogs.com/fanbi/p/8408951.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!