Skip to content

Postgres Setup

Rajesh Khadka edited this page Nov 20, 2019 · 3 revisions

Prerequisites

Must installed the Postgres on your local machine.


After successful installation of the Postgres, follow these steps:

Postgres consist of postgres as a default admin user with all privileges in the database. You can access that user by using the command in Postgres shell.

sudo -u postgres psql

Create a database user

sudo -u postgres createuser <username>

Create Database

sudo -u postgres createdb <dbname>

Set Password of User

sudo -u postgres psql

psql=# alter user <username> with encrypted password '<password>';

Grant all privilages on database

psql=# grant all privileges on database <dbname> to <username>;
Clone this wiki locally