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

MySQL Workbench update语句错误Error Code: 1175.

时间:2016-04-22 23:33:49      阅读:227      评论:0      收藏:0      [点我收藏+]

标签:

rom:http://www.tuicool.com/articles/NJ3QRz

 

MySQL update error:

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. 

mysql有个叫SQL_SAFE_UPDATES的变量,为了数据库更新操作的安全性,此值默认为1,所以才会出现更新失败的情况 ;

因此可按照如下执行:

方法一:

set SQL_SAFE_UPDATES = 0; 
update xxx set xxid = 2;

已验证过

方法二:(未验证)

  1. Go to Edit --> Preferences
  2. Click "SQL Queries" tab and uncheck "Safe Updates" check box
  3. Query --> Reconnect to Server
  4. Now execute your sql query

在命令行界面执行该命令没有这个错误

MySQL Workbench update语句错误Error Code: 1175.

标签:

原文地址:http://www.cnblogs.com/azhqiang/p/5423089.html

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