The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

postgresql connection problem

Discussion in 'General Discussion' started by Secret Agent, Nov 25, 2005.

  1. Secret Agent

    Secret Agent Guest

    I am having trouble with connecting to my postgreSQL database.

    I have created a databse called 'boomid_cms'
    I have created a databse user called 'boomid_root'

    I get following error:
    Warning: pg_pconnect(): Unable to connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "boomid_root", database "boomid_cms", SSL off in /home/boomid/public_html/classes/engine/class.dia_dbinterface.php on line 23

    I am using the following function call:
    pg_pconnect("host=localhost port=5432 dbname=boomid_cms user=boomid_root password=");


    What is the problem exactly that it is not working correctly?
     
  2. DigitalSurgeon

    DigitalSurgeon Well-Known Member

    Joined:
    Aug 13, 2005
    Messages:
    134
    Likes Received:
    0
    Trophy Points:
    16
    Try by changing host from localhost to 127.0.0.1
     
  3. Secret Agent

    Secret Agent Guest

    That does not work either as localhost is translated to the ip
    address == 127.0.0.1.
    Nevertheless I have checked that.

    Here is a error message that appears when calling pg_pconnect()
    function:
    *Warning*: pg_pconnect(): Unable to connect to PostgreSQL server: FATAL:
    no pg_hba.conf entry for host "127.0.0.1", user "boomid_root", database
    "boomid_cms", SSL off in
    */home/boomid/public_html/classes/engine/class.dia_dbinterface.php* on
    line *23*


    I am passing the following connection string parameter to the
    pg_pconnect() function:
    host=127.0.0.1 port=5432 dbname=boomid_cms user=boomid_root
    password=</my password/>
     
  4. Secret Agent

    Secret Agent Guest

    Anyhelp appreciatde. Thank you.
     
  5. Secret Agent

    Secret Agent Guest

    *bump*

    Still cannot resolve this
     
  6. Izzee

    Izzee Well-Known Member

    Joined:
    Feb 6, 2004
    Messages:
    469
    Likes Received:
    0
    Trophy Points:
    16
    I found this snippet in my KB. I know not from whence it came but is all I have on PG except how to uninstall it. ;)
     
  7. Secret Agent

    Secret Agent Guest

    That will delete all the postgresql databases. I cannot do that in my case. I have one client telling me he has trouble connecting to the database itself not creating it.
     
  8. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Tell him to take out the calls to the port and the host. They're not necessary unless you have enabled tcp/ip connections in postgresql.conf. If it's rejecting the connection I'm assuming you haven't. Without those calls it will use the socket in /tmp and everything should work fine.
     
Loading...

Share This Page