DBMS/MySQL

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

RYEAN 2020. 4. 29. 12:38
반응형


 

1. 오류 발생 (Error Occurred)


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.

 

 

2. 오류 원인 (Error Cause)


테이블을 UPDATE 나 DELETE 를 하려고 할 때, KEY 컬럼을 이용한 수정/삭제만 가능하도록 설정되어 있어 KEY 가 아닌 컬럼을 이용하여 수정/삭제 할 경우, 해당 오류가 발생한다.
When trying to UPDATE or DELETE a table, it is set to only allow UPDATE or DELETE using the KEY column. So, when UPDATE or DELETE using not KEY column, the error occurs.

 

 

3. 오류 해결 (Error Resolution)


[Resolution - 1]

아래의 쿼리를 통해 일시적으로 Safe mode 를 해제할 수 있다.

You can temporarily turn off safe mode with the query.

SET  sql_set_updates = 0;

 

 

[Resolution  - 2]

Workbench 의 경우, 아래와 같이 영구적으로 Safe mode 를 해제할 수 있다. 

In the case of the Workbench, You can permanently turn off safe mode.

 

Edit > Preferences...

 

 

SQL Editor > Safe Updates (rejects UPDATEs and DELETEs with no restrictions) 체크 해제 (Uncheck)

 

 

체크를 해제한 후에 workbench 를 종료 후 재시작해야 정상 적용이 된다.

After unchecking, the workbench must restarted.

 

 

 

 

반응형