Skip to content

Instantly share code, notes, and snippets.

@nardhar
Created July 24, 2017 18:11
Show Gist options
  • Save nardhar/9dd12772d416ca65a2a2306127e4a0f2 to your computer and use it in GitHub Desktop.
Save nardhar/9dd12772d416ca65a2a2306127e4a0f2 to your computer and use it in GitHub Desktop.
Postgres CentOS 7
$ sudo yum install postgresql-server
$ sudo postgresql-setup initdb
$ sudo vi /var/lib/pgsql/data/pg_hba.conf

Find the lines that looks like this, near the bottom of the file: pg_hba.conf excerpt (original)

host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident

Then replace "ident" with "md5", so they look like this: pg_hba.conf excerpt (updated)

host    all             all             127.0.0.1/32            md5
host    all             all             ::1/128                 md5

Now start and enable PostgreSQL:

sudo systemctl start postgresql
sudo systemctl enable postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment