0
votes

I`m using postgresql database on my web server (ubuntu + nginx) and it works with backend app. I want to connect remotely using pgAdmin but it always throw this error:

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

connection error

I already add to my pg_hba.conf this line:

host all all all password

and also add to postgresql.conf line:

listen_addresses = '*'

netstat -nlt does next result, and it`s enough in tutuorials i found, but still cant access my database

netstat

2

2 Answers

1
votes

Found a solution, it works as well after this command:

sudo ufw allow 5432/tcp
0
votes

Open file named pg_hba.conf

sudo vi pg_hba.conf

and add this line to that file

host  all  all 0.0.0.0/0 md5

It allows access to all databases for all users with an encrypted password

restart your server

sudo /etc/init.d/postgresql restart