Skip to content

Instantly share code, notes, and snippets.

@chriskief
Last active December 28, 2015 13:39
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chriskief/7509503 to your computer and use it in GitHub Desktop.
# 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
@ChicagoDev
Copy link

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.

@ChicagoDev
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment