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

Discussion in 'General Discussion' started by casey, Aug 3, 2003.

Thread Status:
Not open for further replies.
  1. 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
    Has anyone tried postgresql support yet? I had it installed previously, but I would like to use the cpanel version. Unfortunately, I am unable to create databases. Do I need to uninstall and reinstall postgre first?

    cPanel.net Support Ticket Number:
     
  2. hormigo

    hormigo Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    i will try in a few minutes

    cPanel.net Support Ticket Number:
     
  3. hormigo

    hormigo Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    i have the same problem

    Postgres Account Maintenance


    Database Created
    Added the database test. Password: psql: FATAL 1: Password authentication failed for user "postgres"


    Your should rename conf.php-dist of phppgadmin to conf.php if you want use phpPgAdmin

    cPanel.net Support Ticket Number:
     
  4. 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
    Simply renaming conf.php-dist to conf.php fixes the phpPgAdmin problem, but I don't know what to do for postgres itself. I am going to try removing all postgres files and then re-installing it and see what happens. Fortunately, I don't have anyone using postgres yet, so I can play around a little. If anybody knows what to do, though, I'm all ears.

    cPanel.net Support Ticket Number:
     
  5. 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
    Anybody have a clue? I'm going to get my hands dirty tonight, but I'd just as soon have somebody spoon feed me. :)

    Is there a script to install postgres now?

    cPanel.net Support Ticket Number:
     
  6. 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
    Well, don't go through and delete all postgres files. I did that, and now I'm screwed. I can't reinstall it for some reason. The template1 database is gone and won't come back...:(

    cPanel.net Support Ticket Number:
     
  7. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    Last time that happened, I had to reinstall from rpms... Your unable to connect message is from a file in either /etc/postgres or /var/lib/pgsql/data
    (depending on rpm version -> straight from postgresql.org or through redhat)
    called pg_hba.conf
    make sure you have a
    local all all md5
    host all all 127.0.0.1 255.0.0.0 md5
    or similar, and you should be able to connect from local machine. Checking your docs before erasing is also advised. Erasing postgres files usually makes the problem worse, not better

    cPanel.net Support Ticket Number:
     
  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
    Well, I learned the hard way. I wouldn't have done it though, if I had users using it.

    Re-installing from the rpms does not add template1 anymore for some reason. It gets created when I install from source, but when I try to create a database it tells me that it doesn't have permission to open the file.

    I'll keep working on it. For now I've removed postgres from my features list.:)

    cPanel.net Support Ticket Number:
     
  9. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    I have postgresql working properly and phppgadmin also, the only reason I won't using cpanel phppgadmin is security, since postgresql tool at cpanel require

    if change to
    , phppgadmin tool will not allow you to add user and database.

    cPanel.net Support Ticket Number:
     
  10. 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
    Crap! That was my problem all along. That sucks. Now I have an unworking installation that I can't repair. I don't think I'll be able to repair it, either.:(

    cPanel.net Support Ticket Number:
     
  11. I-Web

    I-Web Well-Known Member

    Joined:
    Jul 7, 2003
    Messages:
    138
    Likes Received:
    0
    Trophy Points:
    16
    How can i remove the postgresql link from cPanel until this gets resolved???

    Its not listed in the feture manager anywhere :(

    cPanel.net Support Ticket Number:
     
  12. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Remove /var/lib/pgsql/data

    run this command => su -l postgres -s /bin/sh -c "/usr/bin/initdb --pgdata=/var/lib/pgsql/data

    It will reinitialize postgresql database

    cPanel.net Support Ticket Number:
     
  13. 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
    Hey Stenny,

    Thanks for your help. I am now getting the following error:

    Any suggestions?:)

    cPanel.net Support Ticket Number:
     
  14. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    verify your file permission, my as below:

    drwx------ 2 postgres postgres 4096 Aug 5 19:20 ./
    drwx------ 6 postgres postgres 4096 Aug 5 19:19 ../
    -rw------- 1 postgres postgres 8192 Aug 5 11:09 1260
    -rw------- 1 postgres postgres 0 Aug 4 18:16 1261
    -rw------- 1 postgres postgres 8192 Aug 4 18:16 1262
    -rw------- 1 postgres postgres 16384 Aug 4 18:16 16430
    -rw------- 1 postgres postgres 16384 Aug 4 18:16 16431
    -rw------- 1 postgres postgres 8192 Aug 4 18:16 16433
    -rw------- 1 postgres postgres 8192 Aug 4 18:16 16434
    -rw------- 1 postgres postgres 16384 Aug 5 11:09 16450
    -rw------- 1 postgres postgres 16384 Aug 5 11:09 16451
    -rw------- 1 postgres postgres 8192 Aug 5 19:19 pg_control
    -rw------- 1 postgres postgres 92 Aug 5 11:05 pg_pwd
    -rw------- 1 postgres postgres 6 Aug 5 19:20 pgstat.stat

    cPanel.net Support Ticket Number:
     
  15. 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
    Hmm. Permissions are the same, but I don't have those last two files:

    -rw------- 1 postgres postgres 92 Aug 5 11:05 pg_pwd
    -rw------- 1 postgres postgres 6 Aug 5 19:20 pgstat.stat

    cPanel.net Support Ticket Number:
     
  16. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    I suggest do not use postgresql tools from cpanel for this moment, because I found postgres user cannot password protect, and all local connection have to be setup with trust. I can using any password to login as postgre user. This is a big security hole.

    cPanel.net Support Ticket Number:
     
  17. 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
    My problem is that I can't use any postgresql tools, not just cPanel.:) Thanks for all your advice, though. You're very kind.

    cPanel.net Support Ticket Number:
     
  18. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    How about remove postgresql package, and reinstall it from OS disto, then follow this tutorial.

    http://linux.cvf.net/cp_postgresql.html

    remember to remove /var/lib/pgsql directory before reinstall.

    cPanel.net Support Ticket Number:
     
  19. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Thats because initially when postgresql is installed the postgres users has no password so you can log in with any password. Its deliberately done like this so the postgres superuser can password protect his account. You need to set the password for postgres yourself and this is a normal function even if you were not trying to access postgresql from Cpanel. Set the password then it will be protected. Setting the password can be done while at the root command line.

    cPanel.net Support Ticket Number:
     
  20. tatter

    tatter Registered

    Joined:
    Dec 17, 2002
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Finally got it to work!

    I was finally able to get mine to work the way (I think) it was intended. I had to set pg_hba.conf to

    local all trust

    until AFTER I created a password for postgres in phpPgAdmin. Then I was able to change the pg_hba.conf file to

    local all md5

    I tried setting it via command line first and then making the switch, but it still wouldn't let me in. After I created a password inside phpPgAdmin though, I was able to change it back to md5, restart postgresql, and it worked! Thanks for all the tips in this thread that helped me figure it all out! :D

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
     
Thread Status:
Not open for further replies.

Share This Page