Skip to content

Instantly share code, notes, and snippets.

@ncabrerax
Last active May 14, 2016 15:49
Show Gist options
  • Save ncabrerax/9475f6ebf7cfffc5d6f9 to your computer and use it in GitHub Desktop.
Save ncabrerax/9475f6ebf7cfffc5d6f9 to your computer and use it in GitHub Desktop.
Terminal:
$ brew install postgresql
/usr/local/Cellar/postgresql/9.5.2
/usr/local/var/postgres
To have launchd start postgresql now and restart at login:
$ brew services start postgresql
$ brew services stop postgresql
$ initdb /usr/local/var/postgres -E utf8
$ sudo gem install lunchy
$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/postgresql/9.5.2/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
$ lunchy start postgres
$ lunchy stop postgres
$ psql -d postgres
$ create user postgres with superuser encrypted password 'gobierna';
$ nano /usr/local/var/postgres/postgresql.conf
$ nano /usr/local/var/postgres/pg_hba.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment