---
title: "Discussion on \"Creating a new Postgres User, Database\" | Hashnode"
description: "Discussion on \"Creating a new Postgres User, Database\". Creating Postgres User, Database easy way\n1.  sudo su postgres \n2.  psql\n3.  CREATE DATABASE database_name;\n4.  CREATE USER my_username WITH PASSWORD 'my_password';\n5.  GRANT ALL PRIVILEGES ON DATABASE \"database_name\" to my_username;\n\nNote: on mac yo..."
url: "https://hashnode.com/posts/creating-a-new-postgres-user-database/62080590a2be760e35396886"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Creating a new Postgres User, Database](https://shrwn.com.np/creating-a-new-postgres-user-database?utm_source=hashnode&utm_medium=feed)

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 yo...

Feb 12, 2022 · 1 min read · shrwn.com.np  
Updated Jul 16, 2024  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)

## Written by

[Shrawan Poudel](https://hashnode.com/@shrawanx)

@shrawanx · Kathmandu, Nepal

  
[View profile](https://hashnode.com/@shrawanx)

shrawanx.com

Working on mission to provide, Software Engineering Trainings easily and freely accessible to everyone through EdTech

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
