Last active
July 8, 2016 15:30
-
-
Save matuu/1b9f4e11c0dea6190255 to your computer and use it in GitHub Desktop.
Postgres, create user & db
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
Option 1 | |
su - postgres | |
psql template1 | |
CREATE USER tom WITH PASSWORD 'myPassword'; | |
CREATE DATABASE jerry; | |
GRANT ALL PRIVILEGES ON DATABASE jerry to tom; | |
Option 2: | |
su postgres | |
postgres@debian: createuser tom | |
postgres@debian: createdb jerry | |
psql template1 | |
\password tom | |
GRANT ALL PRIVILEGES ON DATABASE jerry to tom; | |
import | |
postgres@mimaquina $ psql jerry < dumpfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment