MySQL錯誤:You are using safe update mode and you tried to update a table without a WHERE that uses a K


今日用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,否則你仍然會得到這個錯誤提示。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM