Created
July 14, 2012 20:06
-
-
Save sethcall/3113108 to your computer and use it in GitHub Desktop.
first time postgres database creation made easy
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
# first create a user in the database that is your current username (answer 'y' for superuser if this is a development machine.) | |
sudo su postgres -c "createuser seth" | |
# create a database of the same name, so that just typing 'psql' will drop you into the psql command-line against database 'seth' | |
sudo su postgres -c "createdb seth --owner seth" | |
# now you don't need to sudo for any subsequest pg commands, if you are logged in as this user, for example: | |
initdb /var/lib/pgsql91/data | |
createdb "test_this" | |
psql test_this | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment