1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

RDSのMySQL8.0でロールをユーザーにGRANTしたら1227エラーが発生した。

Last updated at Posted at 2021-05-28

RDSのMySQL8.0において、
マスターユーザーで操作を行い、ロールを別のユーザーに以下のクエリでGRANTしようとしたら次のようなエラーが発生した。

Error Code: 1227. Access denied; you need (at least one of) the WITH ADMIN, ROLE_ADMIN, SUPER privilege(s) for this operation

GRANTのSQLは以下。

GRANT ROLE_ADMIN on *.* to root

結論

ROLE_ADMINという権限を操作ユーザー(マスターユーザー)につける。

GRANT ROLE_ADMIN on *.* to root

AWSサポートで教えていただきました。

補足情報

作業しているユーザーは、rootというマスターユーザー(AWSコンソールで作った)
マスターユーザーの権限は以下。

SHOW GRANTS for current_user;

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE ROLE, DROP ROLE ON *.* TO `developer`@`%` WITH GRANT OPTION
GRANT APPLICATION_PASSWORD_ADMIN,BACKUP_ADMIN,INNODB_REDO_LOG_ARCHIVE,SHOW_ROUTINE ON *.* TO `developer`@`%` WITH GRANT OPTION

いっぱいあるけどROLE_ADMINはついてないんですね〜。不思議。

以上、参考になりましたら幸いです。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?