使用MySQL Workbench 5.2在表上执行更新命令时出错(错误代码:1175) [英] Error (Error Code: 1175) during executing update command on table using MySQL Workbench 5.2

查看:126
本文介绍了使用MySQL Workbench 5.2在表上执行更新命令时出错(错误代码:1175)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用其中包含MySQL Workbench 5.2 CE的MySQL Server5.5.我正在使用MySQL Workbench 5.2.我在数据库中有一个名为 user 的表.我在MySQL Workbench的SQL编辑器上执行了以下命令:

I'm using MySQL Server5.5 in which MySQL Workbench 5.2 CE is included. I'm using MySQL Workbench 5.2 . I have a table named user in DB. I executed the following command on SQL Editor at MySQL Workbench:

UPDATE user SET email = 'abc@yahoo.com' WHERE email='ripon.wasim@yahoo.com';

但不幸的是,我遇到了以下错误:

But unfortunately I got the following 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 Editor -> Query Editor and reconnect.

怎么了?非常感谢您的帮助.

What's the wrong? Help is highly appreciated.

推荐答案

每次尝试更新mysql中的行时都遇到这种错误,这是因为您尝试更新的表没有使用KEY的WHERE列.

Every time you encountered 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.

您可以使用

SET SQL_SAFE_UPDATES=0;
UPDATE user SET email = 'abc@yahoo.com' WHERE email='ripon.wasim@yahoo.com';

或在工作台中

  • 编辑->首选项-> SQL查询
  • 取消选中不带WHERE子句的禁止UPDATE和DELETE语句(安全更新)
  • 查询->重新连接到服务器

这篇关于使用MySQL Workbench 5.2在表上执行更新命令时出错(错误代码:1175)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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