Mysql Update引发错误1175 [英] Mysql Update throws Error 1175

查看:125
本文介绍了Mysql Update引发错误1175的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用带有MySQL Workbench 6.2的MySQL 5.7在表中插入一些行. 尝试时出现错误1175(在安全更新模式下不使用WHERE进行更新)

I want to insert some rows in a table using MySQL 5.7 with MySQL Workbench 6.2. When I try it I get the error 1175 (update without WHERE in safe update mode)

我的查询中还有一个WHERE子句,它也在过滤表的PK.

My query has a WHERE clause in it is filtering the PK of the table too.

这是它的外观:

> update inventory as inv
> 
> set   inv.fk_location          = null
>     , inv.location_description = null
> 
> -- only buffered rows 
> where inv.id_inventory in (
>     select tmp.id_inventory   
>     from tmp_inventory_location as tmp )

subselect给出了两行,其中包含两个库存编号,这些编号也在我要更新的表中.字段id_inventory也是设置为UN AI PK的主键. 因此,就我用谷歌搜索而言,一切都应该没问题.还是我想念一件事? 我真的不希望更改该查询的安全更新模式.

The subselect gives two rows with two inventory_id's which are also in the table I want to update. The field id_inventory is also the primary key with the settings UN AI PK. So as far as I googled it everything should be ok. Or am I missing one thing? I would really dislike to change the safe update mode for that query.

谢谢 费利克斯

推荐答案

执行以下步骤.这可能会有所帮助:

Follow these step. This might help:

  1. 转到编辑",然后选择首选项"
  2. 转到 SQL查询标签,然后取消选中安全更新,然后重新连接.
  1. Go to Edit then preferences
  2. Go to SQL Queries Tab and uncheck the Safe Updates Then reconnect.

这篇关于Mysql Update引发错误1175的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆