Monday, August 25, 2014

Install and configure Postgresql in Centos

How to install and configure Postgresql in Centos

yum install postgresql postgresql-server
chkconfig postgresql on
service postgresql initdb
service postgresql start

Now Postgresql has been installed in your box.

From Windows client i need to connect with this postgresql server. For that i download and install  pgAdminIII http://www.pgadmin.org/download/

Before getting connect, we have to allow remote clients to get connection in the server

Login to the postgresql box
su - postgres
vi /var/lib/pgsql/data/postgresql.conf
Change the line "listen_address='localhost'" to listen_address='*'
Uncomment port 5432 
max_connections=100

Also we have to mention the client IP to allow/trust in postgresql server

vi  /var/lib/pgsql/data/pg_hba.conf  
host all all 192.168.1.0/24 md5
host all all 192.168.3.0/24 md5
 

Restart the service.

Now i can connect to postgresql server from the windows client using the pgAdmin tool 

No comments:

Post a Comment