PGAdmin III cannot connect AWS RDS

血红的双手。 提交于 2020-08-24 10:40:12

问题


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

In Security Group, I also added PostgreSQL and All traffic as below

The "publicly accessible" flag was enabled (updated after Mark B's comment)

I got the error from PGAdmin3

Very appreciate for any suggestion

******UPDATE*******

I can connect pgAdminIII to AWS RDS successfully using home wifi, but cannot connect using office wifi.

My concern is:

Was the port 5432 blocked by office wifi?

How can I configure/update the port without impacting to current API? Note: My current API is working well (CRUD)


回答1:


Can you can test your connection to a DB instance using common Linux or Windows tools first?

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):

$nc -zv DB-instance-endpoint port

For example, the following shows a sample command and the return value:

$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!

Windows users can use Telnet to test the connection to a DB instance. Note that Telnet actions are not supported other than for testing the connection. 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

Connecting To sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com...Could not open connection to the host, on port 819: Connect failed

If Telnet actions return success, then you are good to go.




回答2:


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




回答3:


You will also need to set Public accessibility true under Connect & security tab in RDS console.




回答4:


Read this post.In your security group go to unbound rules and add my ip. and make sure your database is public. https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance



来源:https://stackoverflow.com/questions/42396788/pgadmin-iii-cannot-connect-aws-rds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!