Showing posts with label PostgreSQL. Show all posts
Showing posts with label PostgreSQL. Show all posts

Sunday, 26 August 2012

If you see the above error, open pg_hba.conf  file (/var/lib/pgsql/data/pg_hba.conf) and uncomment or add the line :
local all all trust
Then restart postgresql
# /etc/init.d/postgresql restart

phpPgAdmin Login Failed

Posted by Sarath On Sunday, August 26, 2012 No comments
If you are unable to login to phpPgAdmin using your Cpanel username and password and getting a "Login failed" message do the following :
SSH to your server as root and open /var/lib/pgsql/data/pg_hba.conf
Search for
# "local" is for Unix domain socket connections only
local   all         all                               ident sameuser
Change it to
# "local" is for Unix domain socket connections only
local   all         all                               trust
If that doesn't work or if it is already set to "trust"(uncommeted),
then run the following command to update phppgadmin :
# /usr/local/cpanel/bin/updatephppgadmin --force
Hope it helps...
First check if PostgreSQL is running on the server using ps command.
#ps aux | grep postgre
postgres 4335 2.4 0.2 27704 2936 ?     S  12:07 0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
postgres 4337 0.0 0.0  9972  548 ?     S  12:07 0:00 postgres: logger process
postgres 4339 0.0 0.0 27704  804 ?     S  12:07 0:00 postgres: writer process
postgres 4340 0.0 0.0 10972  544 ?     S  12:07 0:00 postgres: stats buffer process
postgres 4341 0.0 0.0 10148  668 ?     S  12:07 0:00 postgres: stats collector process
root     4346 0.0 0.0  3912  676 pts/5 S+ 12:07 0:00 grep postgre
If you get the above results, it means PostgreSQL is running locally on the server.
Then check parameter "unix_socket_directory" in the PostgreSQL configuration file
(var/lib/pgsql/data/postgresql.conf) and set it to "/tmp/"
ie, unix_socket_directory ="/tmp/"
Then restart PostgreSQL using PostgreSQL daemon or script
#/etc/init.d/postgresql restart or /scripts/restartsrv_postgresql