Wednesday, 15 May 2013

installing postgresql with brew on mountain lion (10.8.2)

start with :
brew update
brew install postgres
add to ~/.bash_profile :
export PATH=/usr/local/bin:$PATH
create your first Db :
initdb /usr/local/var/postgres -E utf8
if you want it to launch at login :
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
I'm using postgresql to wor with Rails, I found gem lunchy quite handy, you might want to try install it for easy start/stop the postgres server. and for now :
psql postgres
you'll have something like this, then, create a new user, I am creating a superuser for now.
postgres# create user root with password new_username;
postgres# alter user new_username with superuser;
postgres# \q

No comments:

Post a Comment