Created
January 16, 2014 01:14
-
-
Save Dexyne/8448039 to your computer and use it in GitHub Desktop.
"Post-it" for create user + database and assign database to user in PostgreSQL.
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
- terminal: | |
createuser -P user_name | |
- Answer questions: | |
enter password for new role: | |
Enter it again: | |
Shall the new role be a superuser? (y/n) n | |
Shall the new role be allowed to create databases? (y/n) n | |
Shall the new role be allowed to create more new roles? (y/n) n | |
- terminal: | |
createdb db_name | |
- terminal: | |
psql db_name | |
grant all privileges on database db_name to user_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment