使用 MySQL Workbench 通过 EC2 实例连接到 Amazon RDS 实例 [英] Connecting to Amazon RDS instance through EC2 instance using MySQL Workbench

查看:62
本文介绍了使用 MySQL Workbench 通过 EC2 实例连接到 Amazon RDS 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 AWS 中,我设置了一个带有堡垒主机的 VPC.堡垒主机是一个带有公共地址槽的 EC2 实例,您可以通过 SSH 连接到 VPC 上的任何其他服务器.

In AWS I have a VPC set up with a Bastion Host. The bastion host is a single EC2 instance with a public address trough which you can SSH to any other server on the VPC.

我在 VPC 中创建了一个 RDS MySQL 实例,我想使用 MySQL 工作台连接到它.我已经按照此处,但是在第 6 步:设置远程 SSH 配置"中,它要求我提供 Amazon EC2 实例的公共 DNS"(即堡垒主机).

I have created an RDS MySQL instance within the VPC and I would like to connect to it using MySQL workbench. I have followed the steps detailed here, however in "Step 6: Setting up remote SSH Configuration", it asks me to "Provide the Public DNS of the Amazon EC2 instance" (i.e. the bastion host).

然后 MySQL 工作台会检查该服务器上的某些 MySQL 资源.但是,这在我看来是不正确的,因为我提供了堡垒主机的地址,该地址没有安装 MySQL.结果,最后两次检查检查启动/停止命令的位置"和检查 MySQL 配置文件"然后失败.

MySQL workbench then does checks for certain MySQL resources on that server. However, this is not correct in my opinion as I have provided the bastion host's address, which does not have MySQL installed. As a result, the last two checks for "Check location of start/stop commands" and "Check MySQL configuration file" then fail.

然后我尝试使用 RDS MySQL 实例的端点地址,但没有成功(因为它位于私有子网中,因此不可公开寻址).

I have then tried using the endpoint address of the RDS MySQL instance but with no success (as it is in the private subnet so is not publicly addressable).

似乎很多人都已经启动并运行了,但我在这里做错了什么?

It seems that many people have this up and running, but what am I doing wrong here?

推荐答案

数周以来,我一直在为类似的问题苦苦挣扎.几分钟前才弄明白.

I've been struggling with something similar for weeks now. Just figured it out a few minutes ago.

  1. 在 mysql 工作台中,创建一个新的服务器实例.
  2. 对于远程主机地址,输入您的端点地址(即 xxxxxx.us-east-1.rds.amazonaws.com)
  3. 对于连接方法,选择Standard TCP/IP over SSH"
  4. SSH 主机名是您的 EC2 实例的公共 DNS
  5. 我将 ec2-user(我相信它因 EC2 实例类型而异)指定为用户名,然后指定与实例使用的密钥对对应的下载密钥文件.
  6. mysql 主机名是 RDS 实例的端点.
  7. 用户名是 RDS 实例的用户名(即 ebroot)

使用它我能够连接.但是,我没有在我的设置中使用 VPC.希望这可以帮助.祝你好运!

Using that I was able to connect. However, I did not utilize VPC in my setup. Hope this helps. Good luck!

这篇关于使用 MySQL Workbench 通过 EC2 实例连接到 Amazon RDS 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆