Re: Why password authentication failed for user "postgres"?

Поиск
Список
Период
Сортировка
От Frank Finner
Тема Re: Why password authentication failed for user "postgres"?
Дата
Msg-id c9a1376f-1692-8ddc-af30-c1f6f5a0ef03@finner.de
обсуждение исходный текст
Ответ на Why password authentication failed for user "postgres"?  (BeginnerC <chuxuec@outlook.com>)
Ответы Re: Why password authentication failed for user "postgres"?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general


On 2022-06-04 00:32, BeginnerC wrote:
Hello everyone,
I am a newbie to the postgres,when I use the psql to connect to the postgres,a error message printed:
These command list like this:

psql -U postgres
Password for user postgres:postgres
postgreSQL: password authentication failed for user "postgres"

How to solve this problem?
Thanks in advance!
  • Which OS are you working on?
  • Can you show us your pg_hba.conf?

If you use -U with psql, the connection must not try to use method "peer" (which means "use the system user with this name", but also means "You must be logged in with the system user corresponding to the postgresql user"), but some kind of authorization, like md5, and use it with IP address. This might be difficult for the user postgres, who often has no password set in the database. If you really need to connect with user postgres and some password, you can set one using the method described by Reid Thompson.

Regards,

Frank


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Andreas Joseph Krogh
Дата:
Сообщение: Logical replication of large objects
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Why password authentication failed for user "postgres"?