Skip to content

Instantly share code, notes, and snippets.

@IamMohaiminul
Last active September 9, 2019 08:26
Show Gist options
  • Select an option

  • Save IamMohaiminul/b8e10d12980fee198247f3f5b70e20e9 to your computer and use it in GitHub Desktop.

Select an option

Save IamMohaiminul/b8e10d12980fee198247f3f5b70e20e9 to your computer and use it in GitHub Desktop.
Install PostgreSQL stable 11.4 (bottled) in macOS Mojave v10.14.6 (18G87) using Homebrew

Update homebrew formulaes

➜ brew update

To install

➜ brew install postgresql

To configure with postgres superuser

➜ initdb /usr/local/var/postgres -E utf8 -U postgres

To start the service

➜ brew services start postgresql

To change the default user and database (can use any, which use most)

➜ echo "export PGUSER=postgres" >> .bash_profile
➜ echo "export PGDATABASE=postgres" >> .bash_profile
➜ source .bash_profile

To start with default value

➜ psql

To start without default value

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