관리 메뉴

SIMPLE & UNIQUE

super privilege cannot be granted/workbench/mysql/RDS 본문

mysql

super privilege cannot be granted/workbench/mysql/RDS

착한코딩 2019. 10. 30. 18:54

RDS mysql 인스턴스 사용시
'super privilege cannot be granted' 메시지

 

1. 함수 생성

Error: 1227 SQLSTATE: 42000 (ER_SPECIFIC_ACCESS_DENIED_ERROR) Access denied; you need (at least one of) the %s privilege(s) for this operation.

2. 마이그래이션

..Access denied foruser'admin'@'%'(using password:YES)

..super privilege cannot be granted...

 

위에 두 가지 경우에 super 권한이 없어서 실행되지 않았다.

 

1. 함수 생성경우에는 RDS파라미터 그룹에서 log_bin_trust_function_creators 값을 변경해주면된다.
(아래 url 참고)

https://aws.amazon.com/ko/premiumsupport/knowledge-center/error-1227-mysqldump/

 

Amazon RDS MySQL 인스턴스에서 자동 백업 또는 복제를 활성화하는 경우 발생하는 ERROR 1227 해결

이 오류는 데이터베이스에서 바이너리 로그가 활성화되었고 mysqldump 파일이 객체(트리거, 보기, 함수 또는 이벤트)를 포함하는 경우에 발생합니다. 자세한 내용은 The Binary Log에 대한 MySQL 설명서를 참조하십시오. create 문에 “NO SQL,” “READS SQL DATA” 또는 “DETERMINISTIC” 키워드가 포함되지 않는 경우 MySQL은 해당 객체를 생성할 수 없고, 가져오기는 오류 1227로 실패합니다.

aws.amazon.com

2. 마이그래이션의 경우

Workbench에서

  2_1) data import를 하려는데  

  'Access denied foruser'admin'@'%'(using password:YES)' 메세지로 실행 불가

  

  2_2) export한 dump파일을 하나씩 실행하려는데 아래 구문에서

        'super privilege cannot be granted' 메세지로 실행 불가

  SET @@SESSION.SQL_LOG_BIN= 0;

  SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ '';

 

결론적으로 해당 문제는 해결하지 못했다. RDS에서 인스턴스를 보호하기 위해 root계정에도 super 권한을 주지 않는다고 한다. 그래서 조금 번거롭지만 dump파일에서 꼭 필요한 create, insert문만 실행해서 마이그래이션을 완료했다.

 

(아래 url 참고)

http://www.fidian.com/problems-only-tyler-has/using-grant-all-with-amazons-mysql-rds

 

Using "GRANT ALL" With Amazon's MySQL RDS - fidian.com

General advice and tips for programmers as well as documentation for open source projects.

www.fidian.com

https://devopslife.io/access-denied-when-using-grant-all-on-in-aws-rds-mysql/

Comments