Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating A New MySQL User In Amazon RDS Environment

I need to create a new MySQL user with limited permission on an existing Amazon RDS instance. After encountering a couple error messages I was sort of able to do this using the official MySQL Administrator tool and the user now appears in the list. However, I'm unable to assign any schema privileges as all the users are greyed out. I'm logged in as the "master user" created when the instance was launched. Not sure where to go from here. I do have the RDS command line tools installed but wasn't able to track down anything there either. Ideas

like image 874
Dan Avatar asked Apr 17 '12 20:04

Dan


People also ask

How do I create a database in MySQL RDS AWS?

To create a MySQL DB instance with Easy createIn the upper-right corner of the Amazon RDS console, choose the AWS Region in which you want to create the DB instance. In the navigation pane, choose Databases. Choose Create database and make sure that Easy create is chosen. In Configuration, choose MySQL.

Does Amazon RDS use MySQL?

Amazon RDS supports MySQL Community Edition versions 5.6, 5.7, and 8.0 which means that the code, applications, and tools you already use today can be used with Amazon RDS.


1 Answers

Your best bet is probably to connect to the database with a mysql command line client and call the SQL commands to create a new user and assign him privileges.

For instance, you might run something like this:

mysql -u [your_master_username] -p -h YOURRDSENDPOINT.rds.amazonaws.com  CREATE USER 'jeffrey'@'%' IDENTIFIED BY 'somepassword'; GRANT SELECT ON [your_database].[some_table] TO 'jeffrey'@'%'; 

On windows you could use the mysql.exe client, wherever that is.

Useful Docs

AWS RDS security groups documentation (a common area of confusion): http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithSecurityGroups.html

User creation documentation: http://dev.mysql.com/doc/refman/5.5/en/create-user.html

Privilege granting documentation: http://dev.mysql.com/doc/refman/5.5/en/grant.html

like image 175
andebauchery Avatar answered Sep 24 '22 07:09

andebauchery