Can't connect to Postgres remotely due to "no pg_hba.conf entry for host"

0

EDIT: Original question was about connecting.

Thanks to the comments, I was notified I had to add firewall rule. I did:

sudo ufw allow 5432/tcp

Now I get a different error FATAL: no pg_hba.conf entry for host "[my_ip]"

Now sure why if I allowed all in that file?


ORIGINAL:

I have a postgresql database set up on my digital ocean droplet running ubuntu 18.

I'd like to connect to it inside PGAdmin 4.

I've edited postgressql.conf:

listen_addresses = '*'

and I've edited pg_hba.conf:

host all all ::/0 md5

then i ran sudo service postgresql restart

Inside PGAdmin, I still get this error:

Unable to connect to server:

could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "[redacted]" ([redacted]) and accepting
TCP/IP connections on port 5432?

the conf file says it's 5432

postgresql
digital-ocean
asked on Stack Overflow Nov 8, 2019 by good_afternoon • edited Nov 8, 2019 by good_afternoon

1 Answer

0

I replaced this addition to the pg_hca.conf file:

host all all ::/0 md5

With

host all all 0.0.0.0/0 md5

And i'm not able to connect with PGAdmin 4

answered on Stack Overflow Nov 11, 2019 by good_afternoon

User contributions licensed under CC BY-SA 3.0