0

我可以通过命令行进行连接,但在 pgadmin3 中收到通常的错误消息。

Error connecting to the server: FATAL: password authentication failed for user "postgres"

login failed在 phppgadmin 中)

我知道有几个关于此的 q/a,但没有一个是解决命令行成功/pgadmin3 失败的问题。

我进行了建议的更改,例如:

加入listen_addresses = '*'_postgresql.conf

还修改如下的尾随行pg_hba.conf(从对等切换到 md5):

# "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.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
# host    replication    postgres        ::1/128                 md5

更重要的是,以下方式的连接失败:

psql -h localhost -U postgres -d postgres

(密码失败)但是,这样的连接成功: sudo -u postgres psql Password: ****

4

1 回答 1

0

事实证明,服务器正在侦听 5433,并且两个 GUI 都试图连接到 5432... 错误消息

password authentication failed

虽然很误导......

于 2015-11-27T13:48:29.497 回答