I am a new user of PostgreSQL, and I am learning it so that I can use it with Django, so I am trying to use the createdb command to create a new database, but even though I am entering the correct password for my account, I am getting this error. I reinstalled everything and checked everything I could think of but I was not able to solve this error. So, if I can get some help regarding this issue it would be nice.
Even using the command psql, and submitting the correct password, gives the same error.
I am using Windows 10.
As far as I checked, I needed to enter the password I used while installing PostgreSQL.
By the way, I am using the latest version of PostgreSQL 14.1
The command I used:
createdb testdatabase
createdb: error: connection to server at "localhost" (::1), port 5432 failed:
FATAL: password authentication failed for user "<username_placeholder>"
<username_placeholder>?postgresas user and password to thepostgresdatabase (which is always installed so you have something to connect to)? You need to provide a bit more info. You can also install postgres using trust authentication, which is fine for local development. No password is needed then postgresql.org/docs/current/auth-trust.htmlpostgres. From your own answer below, that's the-U postgreswhen you connect. Anyway, glad you have it working now.