Created
July 4, 2010 23:01
-
-
Save tigrish/463839 to your computer and use it in GitHub Desktop.
Installing postgres with ports on Snow Leopard
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
sudo port install postgresql84 postgresql84-server | |
# add this to your path | |
:/opt/local/lib/postgresql84/bin | |
# some setup steps | |
sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb | |
sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb | |
sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb' | |
# create a user and a database | |
createuser --superuser <username> -U postgres | |
createdb <dbname> | |
# start up postgres | |
sudo su postgres -c '/opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment