Create Database & User

Article Content


Login as postgres user, and start Postgres session:


sudo su - postgres
psql
    

Create database:


CREATE DATABASE myproject;
    

Create User:


CREATE USER myprojectuser WITH PASSWORD 'password';
    

Set basic settings for newly created user: (fit commands for your needs)


ALTER ROLE myprojectuser SET client_encoding TO 'utf8';
ALTER ROLE myprojectuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE myprojectuser SET timezone TO 'UTC';
    

Grant privileges for newly created user: (fit privileges level to your needs)


GRANT ALL PRIVILEGES ON DATABASE myproject TO myprojectuser;
    

SubArticles


About

Added by dominik

Date: Jan. 13, 2019, 1:58 p.m.

Comments