2022-12-22
閱讀量:
1438
mysql報(bào)錯(cuò)Error Code: 1175. You are using safe update mode
問題:
mysql報(bào)錯(cuò)1175
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.000 sec
解答:
這是由于數(shù)據(jù)庫在安裝之后默認(rèn)了安全模式,需要更改默認(rèn)設(shè)置。
mysql中的SQL_SAFE_UPDATES變量為了保證數(shù)據(jù)的安全性,設(shè)置了默認(rèn)值為1。
當(dāng)SQL_SAFE_UPDATES = 1時(shí),不帶where和limit條件的update和delete操作語句是無法執(zhí)行的,即使是有where和limit條件但不帶key column的update和delete也不能執(zhí)行。
當(dāng)SQL_SAFE_UPDATES = 0時(shí),update和delete操作將會順利執(zhí)行。
當(dāng)出現(xiàn)此報(bào)錯(cuò)時(shí),執(zhí)行SET SQL_SAFE_UPDATES=0; (注意標(biāo)點(diǎn)符號的英文狀態(tài))






評論(0)


暫無數(shù)據(jù)
CDA考試動(dòng)態(tài)
CDA報(bào)考指南
推薦帖子
0條評論
1條評論
0條評論