Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2011

    Unanswered: postgresql - Server doesn't listen


    When I try to create a new server connection, I am facing this error.

    The server doesn't accept connections: the connection library reports
    could not connect to server: Connection refused. Is the server running on host "<ipaddress-of-server>" and accepting TCP/IP connectionson port 5432?

    The server is on Centos5 and have installed postgresql-8.3.3 in it.

    Please help.

  2. #2
    Join Date
    Jun 2004
    Arizona, USA
    How is pg_hba.conf configured on the server? You need to configure the server to accept external connections.

    Ref Chapter 21
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

  3. #3
    Join Date
    Oct 2012

    Restart postgresql

    stop and start posgresql service.. then try the pgagent command.. check .pgpass and pg_hba for password and IP resp..

  4. #4
    Join Date
    Oct 2012
    i am too late to respond on this query. for handling such errors you should check 3 Things
    1) Check the postgresql.conf file in the data directory.
    listen_address='*' must be there.* means that your server will listen on all network cards.

    2)If You have configured your server as per first step and even you are not able to connect then here is second recipe.
    edit the pg_hba.conf file in the data directory and following line (second one)must exist.

    host all all 255.255.255 trust

    as you said that you are trying to create a new server connection it means you must be connecting to your server from third part tool like pgadmin or php admin.
    Now what does this entry mean?
    -host mean that you are connecting through tcp/ip connection.
    -second all under database means that you can connect to any database.
    -Third all under user means that any user can connect.
    -ip address is the address of your system from where you are trying to create the connection to the server next is the corresponding subnet.
    -Method can be trust or md5 if you are connecting by giving a password then use md5

    3) Now even if you have followed step 1 and 2 and still not able to connect to the server then firewall on the OS where database server is installed must be preventing the connection.
    ON centOS just disable the selinux security.

  5. #5
    Join Date
    Jan 2009
    Zoetermeer, Holland
    Funny title. My 1st thought: "Who calls his kid 'Server'?"
    Somewhere between " too small" and " too large" lies the size that is just right.
    - Scott Hayes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts