更新刪除遇到Error Code: 1175
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.
原來是mysql有個叫SQL_SAFE_UPDATES的變數,為了資料庫更新操作的安全性,此值預設為ON
所以只要在執行下面的指令即可
SET SQL_SAFE_UPDATES=0;//關閉
SET SQL_SAFE_UPDATES=0;//關閉
//You want do something...
UPDATE XXXXXX SET XXXXXX WHERE XXXXXXX;
DELETE XXXXXX WHERE XXXXXXX;
SET SQL_SAFE_UPDATES=1;//結束後再開啟
大家可以試試看
留言
張貼留言