I know it is a duplicate questions but their solution not working,
What I'm doing is, connecting to a remote Postgresql database from my local ubunut machine:
psql -h x.x.x.x -U username
But it gives error:
> psql: could not connect to server: Network is unreachable
Is the server running on host "x.x.x.x" and accepting
TCP/IP connections on port 5432?
What I did,
I updated my pg_hba.conf & postgresql.conf files and restarted server using below command:
/etc/init.d/postgresql restart
Which said Ok and restarted
I did NMAP Check from local machine to remote vps shows below output:
root@host:~# nmap x.x.x.x -p 5432
Starting Nmap 5.21 ( http://nmap.org ) at 2015-11-19 15:49 IST
Nmap scan report for x.x.x.x
Host is up (0.16s latency).
PORT STATE SERVICE
5432/tcp filtered postgresql
Output of:
# netstat -plnt |grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 9167/postgres
tcp6 0 0 :::5432 :::* LISTEN 9167/postgres
How can i sort the issue?