今日用MySQL Workbench進行數據庫的管理更新時,執行一個更新的語句碰到以下錯誤提示:
Error Code: 1175
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
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 Workbench的安全設置。當要執行的SQL語句是進行批量更新或者刪除的時候就會提示這個錯誤。
解決方法如下:
打開Workbench的菜單[Edit]->[Preferences...]切換到[SQL Editor]頁面把[Forbid UPDATE and DELETE statements without a WHERE clause (safe updates)]之前的對勾去掉點擊[OK]按鈕最后一步記得要重啟一下Workbench,否則你仍然會得到這個錯誤提示。