Turn off SELinux
Getenforce
Setenfroce 0
Vi/etc/selinux/config
Selinux=disabled
selinuxtype=targeted
Shutting down the firewall
#chkconfig iptables off
#service iptables Stop
Installing Pgsql
# rpm--FORCE-IVH openssl-1.0.1e-42.el6.x86_64.rpm postgresql94-libs-9.4.6-1pgdg.rhel6.x86_64.rpm postgresql94-9.4.6-1pgdg.rhel6.x86_64.rpm postgresql94-server-9.4.6-1pgdg.rhel6.x86_64.rpm postgresql94-contrib-9.4.6-1pgdg.rhel6.x86_64.rpm
#sudo rpm-aq| grep postgres
#sudo Service postgresql-9.4 Initdb
#sudo Service postgresql-9.4 Start
#sudo Chkconfig postgresql-9.4 on
Pgsql Configuration
# nano/var/lib/pgsql/9.4/data/postgresql.conf
Modify the following two parameters:
listen_addresses = ' * '
Port = 5432
# nano/var/lib/pgsql/9.4/data/pg_hba.conf
Modify the parameters as follows:
# IPV4 Local connections:
Host All 127.0.0.1/32 Trust
Reload the configuration file and restart the database:
#/etc/init.d/postgresql-9.4 Reload
#service postgresql-9.4 Restart
#su –postgres
Psql
Alter user postgres with password ' 123456 ';
Create user sample with password ' 123456 ';
Create database sample;
Installing Configuration PostgreSQL