YUMSERV
article thumbnail
반응형

RDS 내에서 함수(function)를 쓰려니, 아래와 같은 에러가 발생하였습니다.

ERROR 1418: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

 

권한을 확인해보니, 현재 모든 권한이 존재하고 있었습니다.

SHOW GRANTS FOR 'test_user'@'%';

Grants for test_user@%
GRANT USAGE ON *.* TO 'test'@'%'
GRANT ALL PRIVILEGES ON *.* TO 'test_user'@'%' WITH GRANT OPTION

 

MYSQL super 권한이 없는 user에게서 발생할 수 있는 문제로, 

log_bin_trust_function_creators 옵션을 ON으로 변경하면 해결됩니다.

log_bin_trust_function_creators 옵션은 MYSQL이 function, trigger 생성에 대한 제약을 강제할 수 있는 기능입니다.

 

 

현재 log_bin_trust_function_creators 옵션 확인

SHOW GLOBAL VARIABLES LIKE 'log_bin_trust_function_creators';

Variable_name Value
log_bin_trust_function_creators OFF

 

변경 쿼리

SET GLOBAL log_bin_trust_function_creators=ON;

1 queries executed, 0 success, 1 errors, 0 warnings
쿼리: SET GLOBAL log_bin_trust_function_creators=ON
오류 코드: 1227
Access denied; you need (at least one of) the SUPER privilege(s) for this operation

 

하지만 해당 옵션이 변경이 되지 않았습니다.

AWS내 RDS내에는 파라미터 그룹이 따로 존재하는데 이쪽에서 해당 값을 변경해주면 됩니다.

 

 

 

설정 변경 후, 쿼리를 통해 변경된 것을 확인할 수 있습니다.

SHOW GLOBAL VARIABLES LIKE 'log_bin_trust_function_creators';

Variable_name Value
log_bin_trust_function_creators ON
반응형
profile

YUMSERV

@lena04301

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!