A
A
Andrey Titov2021-03-15 22:31:39
PostgreSQL
Andrey Titov, 2021-03-15 22:31:39

Why does psql authorization work partially?

Authorization works partially - I changed the password and now it enters interactive mode:

~> psql -d postgres -U postgres
Password for user postgres: 

postgres=#

and when I try to connect via localhost, I get the following error:
~> psql -d postgres -U postgres -h localhost
Password for user postgres: 
psql: error: FATAL:  password authentication failed for user "postgres"

In the configuration file, I tried to install both peer, and md5, and trust - the service rebooted - it does not let me:
# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.

FATAL: password authentication failed for user "postgres" error on command psql -h localhost postgres postgres

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question