Error (Error Code: 1175) during executing update command on table using MySQL Workbench 5.2(使用 MySQL Workbench 5.2 在表上执行更新命令时出错(错误代码:1175))
问题描述
我正在使用 MySQL Server5.5,其中包含 MySQL Workbench 5.2 CE.我正在使用 MySQL Workbench 5.2 .我在数据库中有一个名为 user 的表.我在 MySQL Workbench 的 SQL Editor 上执行了以下命令:
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中的行时遇到这种错误,那是因为你尝试更新一个没有使用的WHERE的表KEY
列.
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 MySQL Workbench 5.2 在表上执行更新命令时出错(错误代码:1175)


- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01