第一季

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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
posted on 2014-05-11 23:26  第一季  阅读(626)  评论(0编辑  收藏  举报