본문 바로가기

Tools

MySQL - safe mode 해제하기

MySQL Workbench를 사용 중인데,


아래와 같이 테이블의 모든 내용을 지우려고 쿼리를 날렸는데 에러가 발생했다.


DELETE FROM test.tb_hms_region;


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


safe mode라는 기능인데, update나 delete를 할 때 where 조건을 사용하여 key 값을 지정하지 않으면 실행 안되게 막아주는 기능인 듯 하다.

어쨋든, 해제하려면

메뉴 - Edit - Preferences - SQL Editor 탭 에서
아래 부분을 체크 해제한다.
"Safe Updates". Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause. Requires a reconnection.

변경 사항을 적용하려면 연결을 다시해야 한다.