天天看點

MySQL Workbench update語句錯誤Error Code: 1175.

rom:http://www.tuicool.com/articles/NJ3QRz

MySQL update error:

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有個叫SQL_SAFE_UPDATES的變量,為了資料庫更新操作的安全性,此值預設為1,是以才會出現更新失敗的情況 ;

是以可按照如下執行:

方法一:

set SQL_SAFE_UPDATES = 0; 

update xxx set xxid = 2;

已驗證過

方法二:(未驗證)

  1. Go to Edit --> Preferences
  2. Click "SQL Queries" tab and uncheck "Safe Updates" check box
  3. Query --> Reconnect to Server
  4. Now execute your sql query

在指令行界面執行該指令沒有這個錯誤