CS/DB

[MySQL]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.

내이름은 킹햄찌 2022. 4. 16. 21:18

 

PK가 지정되어 있는 테이블에서 다른 column을 조건으로 delete 쿼리를 날렸을때 발생한 에러임

 

원인

테이블에서 데이터를 지울때 프라이머리키 이외의 조건으로 update나 delete 쿼리를 날릴때 여러개의 recorde가 수정될 수 없게 되어있기 때문에 설정을 통해 바꿔줘야 함

 

설정은 명령어 또는 메뉴를 통해 옵션을 변경할 수 있음 아래를 참고 

 

명령어

set sql_safe_updates = 0;

 

메뉴를 통한 옵션 변경은 블로그 참고

https://lightblog.tistory.com/193

 

[MYSQL] 에러 번호 1175 Safe Update 해결방법

MySQL에서 쿼리를 실행하다보면 다음과 같은 에러를 마주할 때가 있다. 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..

lightblog.tistory.com