如何将 MySQL Workbench 连接到 Amazon RDS?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28429493/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to connect MySQL Workbench to Amazon RDS?
提问by AnilS
I am accessing the Amazon RDS (MySQL) from Putty. MySQL Workbench works through SSH commandline only, but I would like to access the cloud MySQL host database directly from MySQL Workbench.
我正在从 Putty 访问 Amazon RDS (MySQL)。MySQL Workbench 仅通过 SSH 命令行工作,但我想直接从 MySQL Workbench 访问云 MySQL 主机数据库。
回答by Mike Lischke
In the MySQL forums is a posting that links to various sources for connecting MySQL Workbench to online resources: http://forums.mysql.com/read.php?152,252640,252640#msg-252640. The essential steps for Amazon RDS are on this page: https://thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
在 MySQL 论坛中有一个帖子链接到将 MySQL Workbench 连接到在线资源的各种来源:http: //forums.mysql.com/read.php?152,252640,252640#msg-252640。Amazon RDS 的基本步骤在此页面上:https: //thoughtsandideas.wordpress.com/2012/05/17/monitoring-and-managing-amazon-rds-databases-using-mysql-workbench/
Step 3) Fill in the values as described below which illustrated in Figure 4.
步骤 3) 填写如下所述的值,如图 4 所示。
- Connection Name – Provide a name to identify your connection Connection Method – Select Standard TCP/IP over SSH from the drop down list instead of Standard(TCP/IP). Then on the appearing two tabbed pane, fill the following values found under Parameters tab.
- SSH Hostname – Provide the Public DNS of the Amazon EC2 instace (refer Figure 3) which will be used as the intermediate server instance used to create the connection with the DB instance.
- SSH Username – Provide the user of the Amazon EC2 instance (refer Figure 3) which will be used as the intermediate server instance used to create the connection with the DB instance.
- SSH Key File – Provide the Private Key (xxx.pem) used to connect Amazon EC2 instace via SSH
- MySQL Hostname – Provide the Endpoint of the DB instance created in Amazon RDS(refer Figure 5).
Username – Provide the Master Username of the DB instance created in Amazon RDS(refer Figure 5).
Password – Click on Store in Keychain.. button and type the password provided while creating the DB instance in Amazon RDS.
- 连接名称 – 提供一个名称来标识您的连接 连接方法 – 从下拉列表中选择标准 TCP/IP over SSH,而不是标准 (TCP/IP)。然后在出现的两个选项卡式窗格中,填写在“参数”选项卡下找到的以下值。
- SSH 主机名 – 提供 Amazon EC2 实例的公共 DNS(参见图 3),它将用作中间服务器实例,用于创建与数据库实例的连接。
- SSH 用户名 – 提供 Amazon EC2 实例的用户(参见图 3),该实例将用作中间服务器实例,用于创建与数据库实例的连接。
- SSH 密钥文件 – 提供用于通过 SSH 连接 Amazon EC2 实例的私有密钥 (xxx.pem)
- MySQL 主机名 – 提供在 Amazon RDS 中创建的数据库实例的终端节点(参见图 5)。
用户名 – 提供在 Amazon RDS 中创建的数据库实例的主用户名(参见图 5)。
密码 – 单击 Store in Keychain.. 按钮并键入在 Amazon RDS 中创建数据库实例时提供的密码。
回答by lmiguelvargasf
This solution worked for me. Assuming you have logged into AWS:
这个解决方案对我有用。假设您已登录 AWS:
- Go to RDS -> Databases -> Select your database
- 转到 RDS -> 数据库 -> 选择您的数据库
Check your IP address using http://checkip.amazonaws.com/. If it is not added to the Security Rule Groups, you should add it. this step is crucial
使用http://checkip.amazonaws.com/检查您的 IP 地址。如果未将其添加到安全规则组,则应添加它。这一步很关键
3.1. Click on the rule name. This will open up a new tab, then click in the name of the rule.
3.1. 单击规则名称。这将打开一个新选项卡,然后单击规则名称。
3.2. Click on Edit inbound rules
3.2. 点击编辑入站规则
3.3. Click on Add new rule, and add a rule with the following values:
3.3. 单击添加新规则,然后添加具有以下值的规则:
Type:MYSQL/Aurora.
类型:MYSQL/Aurora。
Protocol:TCP (default)
协议:TCP(默认)
Port range:3306 (default)
端口范围:3306(默认)
Source:My IP -> This will be the IP Address you got at http://checkip.amazonaws.com/.
来源:我的 IP -> 这将是您在http://checkip.amazonaws.com/ 上获得的 IP 地址。
- Fill information in MySQL Workbench
- 在 MySQL Workbench 中填写信息
Hostname: Use the value you have for Endpoint at Connectivity and Security
主机名:使用您在连接性和安全性的端点的值
Port: Use the value you have for Port at Connectivity and Security, by default it is 3306.
端口:使用您在连接和安全中为端口设置的值,默认为 3306。
Username: Use the value you have for master username at Configuration
用户名:使用您在配置中作为主用户名的值
Password: Use the value you set when you created the database instance.
密码:使用您在创建数据库实例时设置的值。
If you forgot the password, you can change it by clicking on Modify in your database instance)
如果您忘记了密码,您可以通过在您的数据库实例中单击修改来更改密码)
回答by AnilS
- In the MySQL Workbench Click on Setup new Connection,
- Give the Connection name and Select the Connection method as Standard TCP/IP,
- Enter the host name from RDS end point and port as 3306,
- Enter Mysql user name and password as given in RDS instance creation,
- Then test the connection and click ok.
- 在 MySQL Workbench 中点击 Setup new Connection,
- 提供连接名称并选择连接方法作为标准 TCP/IP,
- 输入来自 RDS 端点和端口的主机名 3306,
- 输入 RDS 实例创建中给出的 Mysql 用户名和密码,
- 然后测试连接并单击确定。
回答by Azeem Ahmed
Very helpful , was able to make the connection was missing critical part
非常有帮助,能够使连接丢失关键部分
3.3. Click on Add new rule, and add a rule with the following values:
3.3. 单击添加新规则,然后添加具有以下值的规则:
Type: MYSQL/Aurora.
类型:MYSQL/Aurora。
Protocol: TCP (default)
协议:TCP(默认)
Port range: 3306 (default)
端口范围:3306(默认)
Source: My IP -> This will be the IP Address you got at http://checkip.amazonaws.com/.
来源:我的 IP -> 这将是您在http://checkip.amazonaws.com/ 上获得的 IP 地址。