1. 程式人生 > >workbench資料庫批量更新失敗 解決

workbench資料庫批量更新失敗 解決

11:10:40    update tablename set field where XXX is null    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.    0.040 sec
 

因為MySql執行在safe-updates模式下,該模式會導致非主鍵條件下無法執行update或者delete命令。

 

1、show variables like 'SQL_SAFE_UPDATES';檢視開關狀態。

 

2、執行命令SET SQL_SAFE_UPDATES = 0;修改下資料庫模式