Last active
December 28, 2015 13:39
-
-
Save chriskief/7509503 to your computer and use it in GitHub Desktop.
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
# install and select | |
sudo port install postgresql93-server | |
sudo port select --set postgresql postgresql93 | |
# load at startup | |
sudo port load postgresql93-server | |
# create the default database | |
sudo mkdir -p /opt/local/var/db/postgresql93/defaultdb | |
sudo chown postgres:postgres /opt/local/var/db/postgresql93/defaultdb | |
sudo su postgres -c '/opt/local/lib/postgresql93/bin/initdb -D /opt/local/var/db/postgresql93/defaultdb' | |
# create a new user (or you can simply use the default user postgres which does not require a password) | |
createuser --superuser your_username -U postgres -P | |
# create a new database | |
createdb database_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Chris. Your tutorial here is great, and it really helped me out. However, one step is missing during my installation on Mavericks. You may want to add it, as some people may find it necessary also. You can find my changes in the forked gist here: https://gist.github.com/Blake--/18f15c39ac70bdaba20f . I also attribute the command to a Stack Overflow thread.