简体   繁体   中英

AWS MySQL RDS can't create new DB user while having ALL PRIVILEGES

Using my Ubuntu terminal mysql , I have successfully connected to AWS MySQL RDS instance using my master_account account and yet, when I run the standard

CREATE USER 'new_user'@'%' IDENTIFIED BY '12345';

I'm getting the typical ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation error message.

When I run SHOW GRANTS FOR 'master_account' , I get:

+-----------------------------+
| Grants for master_account@%                                                        
|
+-----------------------------+
| GRANT USAGE ON *.* TO 'master_account'@'%'                                         
|
| GRANT ALL PRIVILEGES ON `dbname`.* TO 
'master_account'@'%' WITH GRANT OPTION |
+----------------------+

I must be doing something wrong, but I'm not sure what the issue is as the 'master_account has all privileges, and therefore, I should be able to create new users?

BTW, this RDS instance has been PROMOTED from a read replica for development purposes. Would that be the reason?

So it turned out that while I was logged in with a USERNAME that has all the privileges to manage this specific database , I was not logged in with the AWS MASTER USERNAME that has the privileges to manage DB users.

BTW the MASTER USERNAME is listed in your RDS console under the Configuration tab.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM