在使用mysql執行update的時候,若是不是用主鍵當where語句,會報以下錯誤,使用主鍵用於where語句中正常。html
異常內容: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 Queries and reconnect.mysql
由於MySql運行在safe-updates模式下,該模式會致使非主鍵條件下沒法執行update或者delete命令,執行命令sql
SET SQL_SAFE_UPDATES = 0
修改下數據庫模式數據庫
安全起見,執行完操做後,建議在恢復成默認狀態1安全