Please help to solve this Postgrex

mix phoenix.server
warning: found quoted keyword “test” but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
mix.exs:52

[error] Postgrex.Protocol (#PID<0.256.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password): password authentication failed for user “postgres”
[error] Postgrex.Protocol (#PID<0.253.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password): password authentication failed for user “postgres”

The database user postgres is not allowed to access the database. You should check your config/*.exs in your project as well as /etc/postgresql/<version>/main/pg_hba.conf. The possible causes may be

  • the database uses peer authentication for the user postgres, but you are trying to access the database using password
  • you are trying to access the database from a remote host, but the database only allows access from localhost.
1 Like

Hi,

Welcome to the forum.

In order to offer a a lot more help with your problem:

Can you tell us what operating system are you using?

Is this an old version of Phoenix? Please add some context to your question…

Windows 10

I am Linux user myself but i will try to help you as best I can.

So:

How did you install postgres using the postgres installer or chocolatey(cmd tool)?

Also have you tried to open a cmd from the start menu and type pg_ctl status, if the staus says that is started we are good to go .

In cmd now type psql -U “postgres” press enter and when the password will be asked type postgres,

If your terminal changes to postgres=# you successfully managed to authenticate to postgres server if not here is the problem and we need to see what happened with your default user and password for postgres database.

Try the two command first pg_ctl status and psql -U “postgres” with the password postgres