Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#All parts not labeled BJG were written by Chris Kief <>
# 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'
<BJG>: Uncomment the following lines in /opt/local/var/db/postgresql93/defaultdb/postgresql.conf
#unix_socket_directories = '/tmp'
#unix_socket_group = ''
#unix_socket_permissions = 0777
#Source: jrwren @ <>
# 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