简体   繁体   English

PGAdmin III 无法连接 AWS RDS

[英]PGAdmin III cannot connect AWS RDS

I am trying to connect AWS RDS PostgreSql from PgAdmin 3. I followed the below link http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html我正在尝试从 PgAdmin 3 连接 AWS RDS PostgreSql。我按照以下链接http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html

In Security Group, I also added PostgreSQL and All traffic as below在安全组中,我还添加了 PostgreSQL 和所有流量,如下所示在此处输入图片说明

The "publicly accessible" flag was enabled (updated after Mark B's comment)启用了“可公开访问”标志(在 Mark B 的评论后更新)

在此处输入图片说明

I got the error from PGAdmin3我从 PGAdmin3 收到错误在此处输入图片说明

Very appreciate for any suggestion非常感谢任何建议

******UPDATE******* ******更新*******

I can connect pgAdminIII to AWS RDS successfully using home wifi, but cannot connect using office wifi.我可以使用家庭 wifi 成功将 pgAdminIII 连接到 AWS RDS,但无法使用办公室 wifi 连接。

My concern is:我关心的是:

Was the port 5432 blocked by office wifi? 5432端口是不是被办公室wifi屏蔽了?

How can I configure/update the port without impacting to current API?如何在不影响当前 API 的情况下配置/更新端口? Note: My current API is working well (CRUD)注意:我当前的 API 运行良好(CRUD)

Can you can test your connection to a DB instance using common Linux or Windows tools first?您可以先使用常见的 Linux 或 Windows 工具测试与数据库实例的连接吗?

From a Linux or Unix terminal, you can test the connection by typing the following (replace with the endpoint and with the port of your DB instance):从 Linux 或 Unix 终端,您可以通过键入以下内容来测试连接(替换为终端节点和数据库实例的端口):

$nc -zv DB-instance-endpoint port $nc -zv 数据库实例端点端口

For example, the following shows a sample command and the return value:例如,下面显示了一个示例命令和返回值:

$nc -zv postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299 $nc -zv postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299

Connection to postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299 port [tcp/vvr-data] succeeded!连接到 postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299 端口 [tcp/vvr-data] 成功!

Windows users can use Telnet to test the connection to a DB instance. Windows 用户可以使用 Telnet 测试与数据库实例的连接。 Note that Telnet actions are not supported other than for testing the connection.请注意,除了测试连接外,不支持 Telnet 操作。 If a connection is successful, the action returns no message.如果连接成功,则该操作不返回任何消息。 If a connection is not successful, you receive an error message such as the following:如果连接不成功,您会收到如下错误消息:

C:>telnet sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com 8299 C:>telnet sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com 8299

Connecting To sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com...Could not open connection to the host, on port 819: Connect failed连接到 sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com...无法在端口 819 上打开与主机的连接:连接失败

If Telnet actions return success, then you are good to go.如果 Telnet 操作返回成功,那么您就可以开始了。

If you are trying to access it from a network which is not listed for that port.如果您尝试从未为该端口列出的网络访问它。 you need to add inbound rules for those network IPs from AMAZON RDS system您需要为来自 AMAZON RDS 系统的这些网络 IP 添加入站规则

您还需要在 RDS 控制台的连接和安全选项卡下设置公共可访问性为真。

Read this post.In your security group go to unbound rules and add my ip.阅读这篇文章。在您的安全组中,转到未绑定规则并添加我的 ip。 and make sure your database is public.并确保您的数据库是公开的。 https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance

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

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