Skip to content

Instantly share code, notes, and snippets.

@delbetu
Last active April 19, 2016 23:37
Show Gist options
  • Save delbetu/fd139f0e5cddbcec155224ce8f91fa2d to your computer and use it in GitHub Desktop.
Save delbetu/fd139f0e5cddbcec155224ce8f91fa2d to your computer and use it in GitHub Desktop.
Instructions to install postgres on mac os

#Postgres ##Install

brew install postgresql
brew services start postgresql
initdb /usr/local/var/postgres - create new database cluster
/usr/local/Cellar/postgresql/<version>/bin/createuser -s postgres

##To start server at startup

mkdir -p ~/Library/LaunchAgents
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

##login

psql -U postgres -h localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment