小编nih*_*lon的帖子

使用主键时出现 MySQL 1175 错误

什么会导致以以下开头的错误 1175:You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column...。我的问题是我确实包含了一个WHERE带有键列的子句:WHERE a.a_id = b.b_id

a_id并且b_id是各自表中唯一的键列。

START TRANSACTION;
    UPDATE table_a a, table_b b
    SET a.update_me = b.update_from_me
WHERE a.a_id = b.b_id;
SELECT * FROM a;
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

primary-key update errors mysql-5.6

4
推荐指数
1
解决办法
4142
查看次数

标签 统计

errors ×1

mysql-5.6 ×1

primary-key ×1

update ×1