Thursday, July 31, 2014

PostgreSQL - Installation

1. Version Info

- PostgreSQL 9.3
- CentOS base 6.4 64-bit

2. Installation

- vi /etc/yum.repos.d/CentOS-Base.repo
- add 'exclude=postgresql*' at '[base]'
- yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
- yum list postgres*
- yum install postgresql93-server.x86_64
- service postgresql-9.3 initdb
- cd /var/lib/pgsql/9.3/data/
- vi postgresql.conf
- add "listen_addresses=’*’"
- vi pg_hba.conf
- add "host all all 'your network info'/24 trust"
- service postgresql-9.3 start
- connect to it and create a user by using command or pgAdmin
- vi pg_hba.conf
- change "host all all 'your network info'/24 trust" to "host all all 'your network info'/24 md5"
- service postgresql-9.3 restart