Reputation: 2378
I want to connect to postgresql from another server but occur below error. i search and find some result like below but after do these again error occured
in postgresql.conf change listen_addresses from localhost to *
in pg_hba.conf change 127.0.0.1/32 to 0.0.0.0/0
reboot server
Error:
could not connect to server: Connection refused.Is the server running on host "Ip Number" and accepting.TCP/IP connections on port 5432?
Upvotes: 1
Views: 1217
Reputation: 3714
Try to check if the network traffic reaches the server. You can sniff the network traffic to see what happen. Meassure on client and server and check the communication.
sudo tcpdump -A -n -s 0 -w test_on_client.log port 5432
After you try your connect stop tcpdump with CTRL-C and inspect the log file with Wireshark. This procedure will find every network connection problems.
Upvotes: 1
Reputation: 9219
I suggest that you should do as the following steps.
# TYPE DATABASE USER CIDR-ADDRESS METHOD local all all trust host all all 0.0.0.0/0 md5
Upvotes: 1