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)


基础教程推荐
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01