dwyl / learn-postgresql

🐘 Learn how to use PostgreSQL and Structured Query Language (SQL) to store and query your relational data. 🔍
212 stars 23 forks source link

PostgreSQL failed user login (Windows) #112

Closed MikeRund closed 1 month ago

MikeRund commented 1 month ago

For anyone that ran into the same issue as me, after installing PostgreSQL and setting up password I still ran into an authorization error. The issue was that while my default user existed, a corresponding database hadn't been initialized. To fix I removed authorization following these instructions:

https://www.postgresqltutorial.com/postgresql-administration/postgresql-reset-password/

And then created a database (where {user} is your username):

CREATE DATABASE {user} OWNER {user};

After logging out, resetting the auth method and restarting the issue was fixed.

nelsonic commented 1 month ago

@MikeRund please ensure you include what you researched/found and what the ultimate solution was before closing an issue otherwise it's a dead-end. https://xkcd.com/979/

image