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.
MySQL 啟用 SQL_SAFE_UPDATES=1(安全更新模式)時,UPDATE/DELETE 必須帶有**主鍵或唯一索引欄位**的 WHERE 條件,防止誤執行全表更新/刪除。
SET SQL_SAFE_UPDATES = 0;
-- 執行 UPDATE/DELETE
UPDATE users SET status = 1 WHERE status = 0;
-- 結束後可選恢復
SET SQL_SAFE_UPDATES = 1;
-- 假設 id 為主鍵
UPDATE users SET status = 1 WHERE id > 0; -- 滿足 KEY column 條件
LIMIT