How to install PostgreSQL with yum

How to install PostgreSQL with yum – step by step guide:

Note: Right now do everything as “root” user.

1) check current install status:
yum list postgres*

2) Pick packages you might need (in that sample this is my choice – you might want different packages):

yum install postgresql84 postgresql84-contrib postgresql84-libs

3) Install default DB:

service postgresql initdb

4) Login as a postgres user:

su - postgres

5) Create new user with admin access rights:

createuser -P -s -e username

6) Optional, but really needed for PHP Postgres Admin step – exit from postgres user and edit “pg_hba.conf” so PHP & PHPPostgres Admin can login into your DB (notice word password):

# "local" is for Unix domain socket connections only
local   all         all                               password
# IPv4 local connections:
host    all         all          password
# IPv6 local connections:
host    all         all         ::1/128               ident

That’s all folks. Keep it short and simple!

Posted on January 20, 2012 at 10:36 by admin · Permalink
In: Uncategorized

Leave a Reply