본문 바로가기
ERROR

[SQL] 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.

by sun_HY 2023. 11. 24.

user 테이블에서 테스트계정에 admin 권한을 부여하려고 관리자 컬럼을 바꾸려고 했는데 에러가 났다

엄청 간단한 update 문이었는디

 

update user
	set is_admin=1
	where email='1';

 

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 Editor and reconnect.

 

직역하자면 safe update mode를 사용 중인데 where문을 key가 아닌 것으로 걸어서 에러가 났다는 것 같다.

safe mode를 마음대로 끄면 좀 그럴 것 같아서 key column으로 조건을 바꿨다.

 

update user
	set is_admin=1
	where user_id=1;

 

간단하게 해결!

728x90