I just installed PostgreSQL 13 on Windows 10. In the command prompt I did:
C:\Users\Max>cd ../postgres
I then tried to do the createdb
command and got this error message:
createdb: error: could not connect to database template1: FATAL: password authentication failed for user "Max"
After some research I know that if I don’t specify a database user with -U username
option, it takes the OS username.
When I cd into the postgres
user, why does it still use the user "Max"
?
Is there a way I can change it to authenticate as postgres
when I'm in C:\Users\Max
so I don't have to specify the username every time?