The Sky is not the limit

Entries tagged as ‘Postgresql’

postgres ERROR: role “username” does not exist

October 19, 2009 · Leave a Comment

Issue 1

When I am trying to create Postgre DB using Cpanel, I get the following error:

Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.

Fix 1
You need to install a Postgres authentication configuration file that uses md5 passwords which works with cPanel. You can do this through WHM.

Login to WHM >> SQL Services >> Postgres Config >> Click on “Install Config”.

Issue 2
Okie  now I can create databases with new accounts. But already created accounts have  issues. It says  database created but it actually not creates and shows the following error in cPanel logs

tail -f /usr/local/cpanel/logs/error_log

ERROR:  role “username” does not exist
ERROR:  role “username” does not exist

Fix 2

Login to the server as “root” and execute the following command.

cd /var/cpanel/users && for x in *; do su -c “createuser -S -D -R $x” postgres; done

Categories: cPanel
Tagged: , , , , , ,

Postgresql Installation in CentOS/RHEL servers

April 15, 2008 · Leave a Comment

# yum install postgresql postgresql-server

Start Postgresql
———————
# chkconfig postgresql on
# service postgresql start

Connect to Postgresql Server
———————
# su – postgres
Connect using psql command line tool:
$ psql -d template1 -U postgres

Open TCP port 5432(Postgresql uses port 5432)
———————
Finally make sure iptables allows remote access to Postgresql database server.
Open /etc/sysconfig/iptables file.
# vi /etc/sysconfig/iptables

Append following line before COMMIT line to open port 5432
———————
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5432 -j ACCEPT

Save and close the file. Restart the firewall.

# service iptables restart

Categories: Linux tutorials
Tagged: , ,