Created
August 19, 2015 08:39
-
-
Save awinabi/cfde23af4b3d7fb3e133 to your computer and use it in GitHub Desktop.
Postgres Database Creation
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
##################################################### | |
### Setup database | |
##################################################### | |
# start your database as follows | |
sudo /etc/init.d/postgresql start | |
# create user | |
sudo -u postgres createuser -l -D -S -R sduser | |
# create database | |
sudo -u postgres createdb -O sduser successdart_development | |
sudo -u postgres createdb -O sduser successdart_test | |
# open postgresql console | |
sudo -u postgres psql | |
# and run these statements (note the trailing semi colon) | |
alter user sduser with encrypted password 'sduser'; | |
alter user sduser createdb; | |
grant all privileges on database successdart_development to sduser; | |
grant all privileges on database successdart_test to sduser; | |
\l # show databases | |
\q # for quitting the postgres console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment