'GRANT 'role' TO 'user'@'%' denied with Error Code: 1227 in mysql 8.0 AWS
We are using MySQL version 8.0 on AWS RDS. Logged in with Admin user on the database using MySQL Workbench version 8.0.16 and performed below steps.
CREATE ROLE 'role';
GRANT SELECT, EXECUTE ON schema.* TO 'role';
CREATE USER 'user'@'%' IDENTIFIED BY 'password';
GRANT 'role' TO 'user'@'%';
The last command threw below error
Error Code: 1227. Access denied; you need (at least one of) the WITH ADMIN, ROLE_ADMIN, SUPER privilege(s) for this operation 0.078 sec
We are unable to grant the role to the user. Below are the privileges of the admin 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 ON *.* TO `admin`@`%` WITH GRANT OPTION'
Please help to resolve this issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|