在mysql表中刪除的數(shù)據(jù)的時(shí)候使用了主鍵范圍刪除,sql執(zhí)行失敗了,失敗反饋如下:
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. Cannot use range access on index 'PRIMARY' due to type or collation conversion on field 'MigrationId' To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect
這是因?yàn)镸ySql運(yùn)行在safe-updates模式下,該模式會導(dǎo)致非主鍵條件下無法執(zhí)行update或者delete命令。
查看開關(guān)狀態(tài)。
show variables like ‘SQL_SAFE_UPDATES’;
執(zhí)行命令,修改下數(shù)據(jù)庫模式
SET SQL_SAFE_UPDATES = 0;