Skip to content

Instantly share code, notes, and snippets.

@mbaev
Last active June 24, 2018 15:24
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 mbaev/20acdf99a650e39e1675df3e67b08615 to your computer and use it in GitHub Desktop.
Save mbaev/20acdf99a650e39e1675df3e67b08615 to your computer and use it in GitHub Desktop.
Each new instance requires of creation database and user with access
$ su - postgres
$ createuser username
$ createdb -o username dbname
$ psql -c "ALTER USER username WITH ENCRYPTED PASSWORD 'qwerty'"
$ psql -c "GRANT ALL PRIVILEGES ON DATABASE dbname TO username"
# Add ability role to create databases
$ psql -c "ALTER ROLE username CREATEDB"
# Many abilities here (shortly): https://www.codementor.io/engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment