0

I've initiated a AWS RDS MySQL instance and would like to create an additional user, who has all privileges on all databases;

grant all privileges on *.* to "someuser"@"10.0.0.0/255.255.0.0";
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)

As you can see, I'm not allowed to do so, even though I'm triggering the command as root.

How can I solve this?

  • Try "someuser"@"10.0.0.%" – Rick James Apr 21 '19 at 5:02
1

When using RDS (Managed DB service) you simply can't create a root user as you're trying to do.

Simply use

CREATE USER 'username'@'%' IDENTIFIED BY 'userpassword';
GRANT SELECT ON [your_database].[some_table] TO 'username'@'%';
  • Thanks. The problem is that I have an app, which is managing the databases and I need grant all privileges on *.* ..., as it creating new databases and managing a lot, so it's cumbersome to grant on each one. – chevallier Apr 3 '19 at 13:47
  • 1
    @chevallier if you really want to grant all available privileges on *.* you'll need to run SHOW GRANTS; as the admin user, then copy that list of explicit grants to build the command to make the grant to the new user. You can't grant what you don't have, yourself, and RDS does not give you ALL PRIVILEGES. – Michael - sqlbot Apr 3 '19 at 17:18
0

Since you are essentially trying to create a new root user you can instead give your app the credentials of the existing master user that was created when setting up the RDS. Not that it's a good practice but should solve your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.