Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lpf23/3d8f3000431818f8d050 to your computer and use it in GitHub Desktop.
Save lpf23/3d8f3000431818f8d050 to your computer and use it in GitHub Desktop.
Installing postgres on CentOS - pg_hba.conf modifications
1) # yum install postgresql postgresql-server
2) # chkconfig postgresql on
3) # service postgresql start
4) # sudo -s
5) # su - postgres
6) $ psql -d template1 -U postgres
7) ALTER USER postgres WITH PASSWORD '<newpassword>';
8) \q
9) # cd /var/lib/psql/data
10) # vi pg_hba.conf
Use password authentication (pgAdmin can connect!):
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
11) # service postgresql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment