Installing PostgreSQL

First step:


 	sudo apt-get update
 	sudo apt-get install postgresql postgresql-contrib

Second step:

logging in 

sudo -u postgres psql

Creating user

$ sudo -u postgres createuser <username>

Creating Database

$ sudo -u postgres createdb <dbname>

Giving the user a password

$ sudo -u postgres psql
psql=# ALTER USER <username> with encrypted password '<password>';

Granting privileges on database


psql=# GRANT ALL PRIVILEGES ON DATABASE <dbname> to <username> ;

Leave a Reply

Your email address will not be published. Required fields are marked *