PostgreSQL - Failed to connect to the database '' FATAL: Ident authentication failed for user "postgres": различия между версиями

Материал из Wiki - Iphoster - the best ever hosting and support. 2005 - 2023
Перейти к:навигация, поиск
 
Строка 6: Строка 6:
 
  Failed to connect to the database 'FATAL: Ident authentication failed for user "postgres"
 
  Failed to connect to the database 'FATAL: Ident authentication failed for user "postgres"
  
означает, что в конфиг файле /var/lib/pgsql/10/data/'''pg_hba.conf''' (для 10 версии) стоит запрет на подключение.<br />
+
означает, что в конфиг файле PostgreSQL - /var/lib/pgsql/10/data/'''pg_hba.conf''' (для 10 версии) стоит запрет на подключение.<br />
 
Решение - заменить '''ident или peer''' на '''md5 или trust''' <br />
 
Решение - заменить '''ident или peer''' на '''md5 или trust''' <br />
  

Текущая версия на 17:11, 23 июня 2020

Доступная цена

PostgreSQL - Failed to connect to the database 'FATAL: Ident authentication failed for user "postgres"

Ошибка при подключении к базе PostgreSQL

Failed to connect to the database 'FATAL: Ident authentication failed for user "postgres"

означает, что в конфиг файле PostgreSQL - /var/lib/pgsql/10/data/pg_hba.conf (для 10 версии) стоит запрет на подключение.
Решение - заменить ident или peer на md5 или trust

Если было так:

local   all             all                                     peer
host    all             all             127.0.0.1/32            ident
host    all             all             ::1/128                 ident
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            ident
host    replication     all             ::1/128                 ident


то нужно заменить на

local   all             all                                     trust
host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

или на

local   all             all                                     trust
host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust


и перезапустить PostgreSQL (10 версии):

# systemctl restart postgresql-10