rootで以下を実行。
yum install postgresql-server
postgresql-setup initdb
cp postgresql.conf postgresql.conf.org
vimで以下を設定。
listen_addresses = 'localhost'
port = 5432
rootで以下を実行。
cp pg_hba.conf pg_hba.conf.org
vimで以下を設定。
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
rootで以下を実行してPostgreSQLを起動。
systemctl start postgresql.service
ユーザーで以下を実行し動作確認。
psql -U postgres -h localhost -w