龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開發(fā),龍巖分銷系統(tǒng)

mysql workbench 關(guān)閉安全更新模式

2019.09.01 | 1880閱讀 | 0條評(píng)論 | 數(shù)據(jù)庫

使用Mysql workben時(shí)候執(zhí)行update,select,例如下列代碼時(shí)候,


update student set Sage=0;

update student set age=age+1;

常常出現(xiàn)錯(cuò)誤


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打開了安全更新模式。解決方法就是關(guān)閉安全更新模式。

解決方法一:

 SET SQL_SAFE_UPDATES = 0;


解決方法二:

1、點(diǎn)擊edit->preferences 或者如下圖右上角的按鈕


20190901205236.png

贊 (

發(fā)表評(píng)論