PostgreSQL Connection Refused

Hi,

I have installed Postgresql 8.3 successfully on my windows machine. And able to connect to the databases from my machine. But when I try to make connection to it from other machine (Client Installed)
It returns error:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host  and accepting TCP/IP connections on port 5432 on Windows

I also made an entry into hba.config file
host    all         all         127.0.0.1/32           trust
But this not work

Please advice.
sitgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

earth man2Commented:
see http://www.postgresql.org/docs/8.3/static/runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS


make sure that

listen_addresses="*"

is set in the postgresql.conf file
or specifies your ip addresses of your lan/wan adapter
if that checks out check the firewall settings and allow traffic on port 5432.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cminearCommented:
The change you described to the HBA config file is insufficient.  The IP address '127.0.0.1' is for localhost; _every_ computer will typically have 127.0.0.1 set for themselves.  So if your remote client tries to connect to 127.0.0.1, it would really be trying to connect to itself.  As the database is not running on the client, the connection attempt will fail.

Assuming your client has an address of '1.2.3.4', add the following line to the HBA config file:
host           all               all          1.2.3.4/32            md5

If you want to allow access from any host on a network, modify the "32" bitmask to the appropriate setting ("24" for a Class C, for example).  Also, 'md5' will require MD5-hashed passwords to be passed.

Make sure you leave the line you gave, so that you can continue to connect to the database from the server itself.

Check http://www.postgresql.org/docs/8.3/static/auth-pg-hba-conf.html for more details.
0
gheistCommented:
Also - run service executable from command line and add firewall exception.
0
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

gheistCommented:
/NR ?
0
cminearCommented:
Well, of course, I think _my_ answer was the correct solution. ;)

In all seriousness, based on the asker's information, the pg_hba.conf file would have needed a change similar to what I proposed.  However, if that would have been the complete solution or the second part of the complete fix after earthman2's suggested fix for the server connection, we'll never know without sitg.  gheist's firewall suggestion effectively duplicate's earthman2's.

I guess I would recommend the bulk of the points split between earthman2 and myself.  
0
gheistCommented:
I agree...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PostgreSQL

From novice to tech pro — start learning today.