Last active
June 24, 2018 15:24
-
-
Save mbaev/20acdf99a650e39e1675df3e67b08615 to your computer and use it in GitHub Desktop.
Each new instance requires of creation database and user with access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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