Last active
December 15, 2015 19:29
-
-
Save kixorz/5311705 to your computer and use it in GitHub Desktop.
Create user and db on 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
| CREATE USER <user> WITH PASSWORD '<password>'; | |
| CREATE DATABASE <db>; | |
| CREATE SCHEMA <schema>; | |
| GRANT ALL PRIVILEGES ON DATABASE <db> TO <user>; | |
| GRANT ALL PRIVILEGES ON SCHEMA <schema> TO <user>; | |
| GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA <schema> TO <user>; | |
| #clone db command | |
| createdb -O <owner> -T <db> <new db> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment