Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
Created March 17, 2014 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save valyakuttan/9604295 to your computer and use it in GitHub Desktop.
Save valyakuttan/9604295 to your computer and use it in GitHub Desktop.
PostgreSQL Installation and first time configuration from http://stackoverflow.com/questions/1471571/how-to-configure-postgresql-for-the-first-time
#!/bin/sh
# from http://stackoverflow.com/questions/1471571/how-to-configure-postgresql-for-the-first-time
#
# debian jessie
# PostgreSQL 9.3
sudo apt-get install postgresql postgresql-client
# connect to standard system database template1
sudo -u postgres psql template1
#on template1=# prompt type "ALTER USER postgres with encrypted password 'xxxxxxx';" to add a password
sudo emacs -nw /etc/postgresql/9.3/main/pg_hba.conf
# And change "peer" to "md5" on the line concerning postgres
# local all postgres md5
sudo /etc/init.d/postgresql restart
# Create a user having the same name as you
createuser -U postgres -d -e -E -l -P -r -s $USER
# change in pg_hba.cong peer to md5 at
# local all all md5
# Restart and check that you can login without -U postgres :
psql template1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment