创建一个新的MySQL用户在亚马逊RDS环境亚马逊、创建一个、环境、用户

2023-09-11 10:23:41 作者:习惯后的伤痛

我需要在现有的亚马逊RDS实例来创建一个新的MySQL用户提供有限的权限。遇到一对夫妇的错误消息后,我是那种能使用官方的MySQL管理工具,现在出现在列表中的用户这样做。但是,我无法为所有的用户都变灰指定任何模式的特权。我登录的时候,比如发起创建的主用户。不知道在哪里何去何从。我已经安装了RDS的命令行工具,但无法追查任何事情有两种。创意

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

推荐答案

您最好的选择可能是连接到数据库使用mysql命令行客户端,并调用SQL命令来创建一个新用户,并指定他的特权。

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'@'%';

在Windows中,您可以使用mysql.exe客户端,无论是。

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

有用的文档

AWS RDS安全组文件(混乱的公共区域):http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithSecurityGroups.html

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

用户创建的文档:http://dev.mysql.com/doc/refman/5.5/en/create-user.html

权限授予文件:http://dev.mysql.com/doc/refman/5.5/en/grant.html