본문 바로가기
프로그래밍/Database

[Mysql Workbench] Update,Delete 쿼리 실행 시 오류

by LiveData 2018. 11. 21.
반응형

Workbench에서 Update,Delete 쿼리문을 입력하였을 경우 아래와 같은

오류를 볼 수 있습니다.

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 모드 상태 조건절에 Primary key 컬럼을 사용하지 않을 경우 오류를 낸다.



해결

-- 0설정 : Safe Update 모드 해제 ,   1설정 : Safe Update 모드
SET SQL_SAFE_UPDATES =0;

SQL Editor -> Safe Updates 모드 체크 해제



위와 같은 방법으로 하면 Update,Delete 시 조건 절에 Primary key를 사용 하지 않고

쿼리를 실행시킬 수 있습니다.

반응형