在 Amazon RDS 环境中创建新的 MySQL 用户 [英] Creating A New MySQL User In Amazon RDS Environment
问题描述
我需要在现有 Amazon RDS 实例上创建一个具有有限权限的新 MySQL 用户.在遇到几条错误消息后,我可以使用官方 MySQL Administrator 工具执行此操作,并且该用户现在出现在列表中.但是,我无法分配任何架构权限,因为所有用户都显示为灰色.我以实例启动时创建的主用户"身份登录.不知道从这里去哪里.我确实安装了 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
这篇关于在 Amazon RDS 环境中创建新的 MySQL 用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!