10
[root@pghost postgresql-9.3.4]# su - postgres
[postgres@pghost ~]$ initdb -D $PGDATA -E UTF8 --locale=C -U postgres -W
...
...
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
postgres -D /opt/pgsql9.3.4/pgdata
or
pg_ctl -D /opt/pgsql9.3.4/pgdata -l logfile start
15
[root@pghost ~]# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
[root@pghost ~]# /etc/init.d/iptables restart
16
[root@hostalonetest ~]# /opt/PostgreSQL/9.3/bin/psql -h 192.168.19.77 -Upostgres
Password for user postgres:
psql.bin (9.3.5, server 9.3.4)
Type "help" for help.