简体   繁体   English

无法在我的笔记本电脑上连接到 AWS RDS(尽管我的 laravel 应用程序通过弹性 beantalk 托管可以与 RDS 交互)

[英]Unable to connect to AWS RDS on my laptop (although my laravel app which is hosted via elastic beanstalk can interact with the RDS)

I created an AWS Elastic Beanstalk env and deployed my laravel app.我创建了一个 AWS Elastic Beanstalk 环境并部署了我的 laravel 应用程序。 My laravel app can connect to the database but i cannot connect to the database using any database client on my laptop.我的 laravel 应用程序可以连接到数据库,但我无法使用笔记本电脑上的任何数据库客户端连接到数据库。

I have already added my IP address under EC2 -> Security Groups -> Inbound rules (followed an advice from another stackoverflow post) Inbound rule entry我已经在 EC2 -> 安全组 -> 入站规则下添加了我的 IP 地址(遵循另一个 stackoverflow 帖子的建议)入站规则条目

My RDS access is Publicly accessible under RDS -> Databases -> Connectivity & Security我的 RDS 访问权限可在 RDS -> 数据库 -> 连接性和安全性下公开访问

I keep getting this mysql client error我不断收到此mysql 客户端错误

What am I missing here?我在这里错过了什么? Do I need to change anything else for accessing the RDS remotely.我是否需要更改任何其他内容才能远程访问 RDS。

Thanks!谢谢!

Is this RDS instance in a private or a public su.net?此 RDS 实例是在私有还是公共 su.net 中? If it's in a private su.net, it'll not be reachable from outside the VPC.如果它在私有 su.net 中,则无法从 VPC 外部访问它。 You'll have to create a jump server to connect to it.您必须创建一个跳转服务器才能连接到它。

You can go through a few checks if RDS is already in the public su.net.如果 RDS 已经在公共 su.net 中,您可以通过一些检查 go。

  1. make sure SG attached to RDS has an ingress rule on the Mysql port for your IP address.确保连接到 RDS 的 SG 在 Mysql 端口上为您的 IP 地址设置了入口规则。
  2. if your IP address is dynamic, make sure it hasn't changed after adding the ingress rule to SG.如果您的 IP 地址是动态的,请确保在将入口规则添加到 SG 后它没有更改。
  3. make sure that the public su.net's route table has a route to the inte.net gateway as well.确保公共 su.net 的路由表也有到 inte.net 网关的路由。
  4. check instance reachability by running the command te.net <RDS_hostname> <Port> on the terminal.通过在终端上运行命令te.net <RDS_hostname> <Port>检查实例可达性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM