Postgresql 10.x installer configures password wrong? (Windows)
-
27-12-2020 - |
Question
I am new to PostgreSQL, but I just installed 10.x and was asked to type a root/admin password which I could not leave empty. I hence entered a password I know very well since i only intend for this to be a localhost database.
But when prompted by 3rd party application which uses PostgresSQL to login I only know password - and I can not login correctly.
Being optimistic I tried to start pgbench.exe from commandline which asks for password - but it says that password authentication failed for my name.
Is here anyway to reset password and setup a proper user/password account or somehow fix the situation? And maybe some kind of frontend tool I can use for testing? I have searched for pg_hba file, but I only have a "sample" file.
I have installed into path D:\databases\Postgresql\10
Solution
If you are using the EDB installer, when it asks for a password, that is the password for the PostgreSQL user named postgres
, not for the user named tom
.
Perhaps there is a way to make our 3rd party app connect as postgres
?
Or if you want it to use the database role whose name matches your Windows account name, you should be able to connect with
psql.exe -U postgres postgres
And then:
create user tom with password 'hi tom';