Shrawan Poudel
Shrawan's Blog

Shrawan's Blog

Creating a new Postgres User, Database

Shrawan Poudel
·Feb 12, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Creating Postgres User, Database easy way

1.  sudo su postgres 
2.  psql
3.  CREATE DATABASE database_name;
4.  CREATE USER my_username WITH PASSWORD 'my_password';
5.  GRANT ALL PRIVILEGES ON DATABASE "database_name" to my_username;

Note: on mac you can psql postgres to enter postgres shell