Can't connect pgadmin III to postgreSQL db

Ian Pilcher i.pilcher at comcast.net
Mon Jan 26 02:35:17 UTC 2004


Adam L. Klein wrote:
> I've just installed pgadmin3 from http://www.pgadmin.org/.  I'm
> running postgreSQL on FC-1 with all the latest updates.  I have
> created a few small tables (as the postgres user).  I can query, add,
> delete, etc. records... but when I start pgadmin3, I get an error:
> 
> ~    An error has occurred:
> 
> Error connecting to the server: could not connect to server:
> Connection refused
> ~    Is the server running on host "192.168.0.3" and accepting
> ~    TCP/IP connections on port 5432?
> 
> (I've also tried localhost, 127.0.0.1 and the hostname I've assigned
> to the local machine).  No matter what, I get this error (with the
> hostname different).  I haven't done any config on postgreSQL and the
> default config file specifies port 5432.  Any ideas?  I'd appreciate
> any insight as a frontend would make learning postgreSQL a bit easier.

I take it that you've used psql to do everything so far?  If so, you're
probably connecting via a UNIX socket (the default), rather than a
network socket.  To confirm that this is the problem, try the following:

   psql -U postgres template1
   [enter the password, if prompted]

This should work.

   psql -h localhost -U postgres template1
   [enter the password, if prompted]

If this fails, my suspicions are confirmed.  First, you need to edit
/var/lib/pgsql/data/postgresql.conf and set "tcpip_socket = true".  You
may also need to edit /var/lib/pgsql/data/pg_hba.conf, if you want to
allow connections to any address other than 127.0.0.1.  (Doing this
without turning on password-based authentication would probably be a
bad idea.)

-- 
========================================================================
Ian Pilcher                                        i.pilcher at comcast.net
========================================================================






More information about the fedora-list mailing list