Created
March 17, 2014 17:38
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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