Shrawan Poudel
Shrawan's Blog

Follow

Shrawan's Blog

Follow

Creating a new Postgres User, Database

Shrawan Poudel's photo
Shrawan Poudel
ยทFeb 12, 2022ยท

1 min read

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