解决MySQLWorkbench中执行mysql更新多条数据时失败
作者:三味书屋 来源:原创 2021/7/20 11:33:32

今天在MySQL Workbench中执行一句更新语句时,提示失败:

执行的SQL是:

update  basedb.parameters set datasource=-1  where datasource=0



11:20:44 update  basedb.parameters set datasource=-1  where datasource=0 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. 0.000 sec

datasource并不是主键ID,我希望更新多个数据。


由于mysql有所谓的安全模式,执行更新时不指定ID限定范围,会提示错误



解决方法:

打开edit->Preferences,取消


取下勾选safe updates,保存后重新连接


称      呼:
联系方式:
您的评论:
技术支持:l.w.dong@qq.com www.luweidong.cn
广州市   wx:lwdred
Copyright © 2014 三味书屋 All Rights Reserved
技术支持:l.w.dong@qq.com  sitemap xml  sitemap html

粤公网安备44010602011869号

粤ICP备13031080号-1