Skip to content

Instantly share code, notes, and snippets.

@toranb
Created December 23, 2018 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toranb/fb2836422f9cd67f760fccaeca3ad8a8 to your computer and use it in GitHub Desktop.
Save toranb/fb2836422f9cd67f760fccaeca3ad8a8 to your computer and use it in GitHub Desktop.
First time install of postgres on macOS Mojave
1) Install homebrew if you haven't already
https://brew.sh/
2) Install postgres
brew install postgresql
3) Start the database
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
4) Connect to postgres
psql postgres
5) Add a new role for "postgres"
CREATE ROLE postgres superuser;
6) Give this role login
ALTER ROLE "postgres" WITH LOGIN;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment