Timeout expired pgadmin Unable to connect to server

Viewed 46403
5 Answers

It's an issue with AWS inbound rules not pgAdmin. Follow this guide to solve it. It works.

In the file pg_hba.conf you have to change:

host    all             all             <your_ip/mask>          ident

to:

host    all             all             <your_ip/mask>          md5

<your_ip/mask> is your ip address where you are connecting from. For example 10.1.1.5/32.

You have to add one if it doesn't exist yet.

I'm using CentOS so the file pg_hba.conf is located in /var/lib/pgsql/data for me. If you don't know where the file is located on your OS you can use the search to find the file.

What worked for me is before saving go to advanced tab and in connection timeout give 100 or any bigger number and then save.

  • Go to "Security group rules" (under "Connectivity & security")
  • Click the item "default" Security group
  • Click "Actions" > "Edit inbound rules" > "Add rule"
  • Select... Type: "All traffic", Source: "My IP", then click "Save rules"

Same issue for me with a brand new Debian 10 installation.

pg_hba.conf


#IPv4 local connections:
host    all             all             all          md5

#IPv6 local connections:
host    all             all             all          md5


postgresql.conf

listen_addresses = '*'

I restart postgresql service after with sudo service postgresql restart. Status is active and when I run

netstat -nlp | grep 5432

I get

tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      1071/postgres
tcp6       0      0 :::5432                 :::*                    LISTEN      1071/postgres

In this example I add all hosts, I know it's not a secure way, but it's still a test, I will filter by Ip adresses after.

Is there a particular configuration with nftables firewall to set up ?

Related