Last active
March 1, 2016 11:43
-
-
Save jose8a/55dae50e23ee38565447 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
### System upgrade and PG Install | |
#``` | |
sudo apt-get update | |
#sudo apt-get dist-upgrade | |
sudo apt-get install postgresql postgresql-contrib | |
#``` | |
### Switch to User Postgres and | |
### ... change postgres user default password and perms | |
#```pg | |
# $> sudo -u postgres psql | |
# postgres=> alter user postgres password 'apassword'; | |
# postgres=> create user yerusername createdb createuser password 'somepass'; | |
# postgres=> create database yerusername owner yerusername; | |
# postgres=> \q | |
# $> | |
#``` | |
### ... now as your regular user 'yerusername' you can connect to postgres, and | |
### ... have the privileges to create new users and databases. | |
### | |
### ... That sequence also modified the postgres user's password in case you | |
### ... change the default authentication method to md5 (this is set in | |
### ... pg_hba.conf, see the documentation for more details) | |
### Editing server configs ... then restarting server to allow changes to take effect | |
#``` | |
sudo /etc/init.d/postgresql reload | |
sudo /etc/init.d/postgresql restart | |
#``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment