0

I wanted to connect to a public postgres from my EC2 machine but not able to establish a connection. I have added a outbound rule for postgress port 543 but no luck so far.

Below is the details of the postgress i am trying to connect.

conn = psycopg2.connect(
    host="hh-pgsql-public.ebi.ac.uk",
    database="pfmegrnargs",
    user="reader",
    password="NWDMCE5xdipIjRrp")

Also attached is the outbound rule and error message for reference.

enter image description here

enter image description here

Appreciate all your help !!

  • Can you connect from your local machine (or any other computer on the internet)? I can not `ping` that host. Maybe the host is behind a firewall? – SebDieBln Jan 05 '23 at 14:39
  • Yes I am able to connect the database from my local machine.... – Bhavesh Jain Jan 05 '23 at 14:42
  • And you are not by any chance on the same network as the host, so that your local machine can reach it but ordinary machines on the internet can not? – SebDieBln Jan 05 '23 at 14:46
  • No !! From my local machine (ordinarry machine) i am able to connect to the database. But from EC2 i am facing the connection issue. And it's a public database ideally you should be able to connect as well from your machine unless there is some firewall setting blocking it. – Bhavesh Jain Jan 05 '23 at 14:56
  • That should work, it works for me on EC2. Maybe your instance is running some kind of internal firewall or enhanced security feature that is causing problems. – jjanes Jan 05 '23 at 18:59
  • How can i check and disable the firewall, can you please help? – Bhavesh Jain Jan 06 '23 at 10:01

0 Answers0