没有不值得去解决的问题,也没有不值得去学习的技术!

Analyze and Resolve Error Code: 1175 When Running an UPDATE Statement in MySQL Workbench

Error: Error Code: 1175, the specific error message is as follows:

1. I executed the UPDATE statement in MySQL Workbench, the statement is as follows:

SQL

UPDATE `cpa_channel_app_source` SET `group_id` = '015ce30b116ce86058fa6ab4fea4ac63' WHERE (`group_id` = 'spider');

2. An error occurred: Error Code: 1175, the specific error message is as follows:, as shown in Figure 1

Error: Error Code: 1175, the specific error message is as follows:
Figure 1
SQL

UPDATE `cpa_channel_app_source` SET `group_id` = '015ce30b116ce86058fa6ab4fea4ac63' WHERE (`group_id` = 'spider')
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 and reconnect.

3. I executed the UPDATE statement in phpMyAdmin, the statement is as follows: The execution was successful, as shown in Figure 2

Executed the UPDATE statement in phpMyAdmin, the statement is as follows: Execution successful
Figure 2
SQL

UPDATE `cpa_channel_app_source` SET `group_id` = '015ce30b116ce86058fa6ab4fea4ac63' WHERE (`group_id` = 'spider');

4. According to the prompt, to disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. Uncheck the safe update option, as shown in Figure 3

According to the prompt, to disable safe mode, toggle the option in Preferences - >SQL Editor and reconnect. Uncheck the safe update option
Figure 3
Plaintext

Safe Updates (rejects UPDATEs and DELETEs with no restrictions)

5. After closing the connection, I reconnected and executed the UPDATE statement, the statement is as follows: The execution was successful, as shown in Figure 4

After closing the connection, reconnect and execute the UPDATE statement, the statement is as follows: Execution successful
Figure 4
SQL

UPDATE `cpa_channel_app_source` SET `group_id` = '015ce30b116ce86058fa6ab4fea4ac63' WHERE (`group_id` = 'spider');

Plaintext

UPDATE `cpa_channel_app_source` SET `group_id` = '015ce30b116ce86058fa6ab4fea4ac63' WHERE (`group_id` = 'spider')
1 row(s) affected Rows matched: 1  Changed: 1  Warnings: 0

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系