码迷,mamicode.com
首页 > 其他好文 > 详细

1175_UPDATE报错[转]

时间:2017-03-13 11:35:45      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:comm   pad   ges   ssi   png   keyword   mod   code   any   

技术分享

技术分享

When you execute the update/delete request in MySQL workbench and you got the message error as:

You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

And in MySQL Workbench also mention how we solve this issue as well by following message:

To disable safe mode, toggle the option in Preferences -> SQL Editor -> Query Editor and reconnect

Every found that kind of error when trying to update rows in MySQL? It’s because you tried to update a table without a WHERE that uses a KEY column. In my case, I don’t use even WHERE clause:

1
2
3
delete from order_detail;
 
delete from order;

Any way, the quick fix is to add SET SQL_SAFE_UPDATES=0; before your update/delete query.

1
2
3
4
SET SQL_SAFE_UPDATES=0;
delete from order_detail;
 
delete from order;

Or follow what MySQL Workbench mentioned as here:

To disable safe mode, toggle the option in Preferences -> SQL Editor -> Query Editor and reconnect

Here is the screenshot in MySQL Workbench 5.2.40 CE

技术分享

MySQL Workbench 5.2 – Error 1175

 

It might help for those who first experience with MySQL Workbench.

If any possibly solutions found, just drop here in the comment.

1175_UPDATE报错[转]

标签:comm   pad   ges   ssi   png   keyword   mod   code   any   

原文地址:http://www.cnblogs.com/jojo123/p/6541738.html

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