标题: pgsql:connection failed: connection to server at “::1“, port 5432 f [打印本页] 作者: 温锦文欧普厨电及净水器总代理 时间: 2025-3-8 11:24 标题: pgsql:connection failed: connection to server at “::1“, port 5432 f psql: 错误: 连接到"127.0.0.1"上的服务器,端口5432失败:致命错误: 用户 "postgres" Password 认证失败
密码不对,需要重置密码
一.先确保环境变量设置正确
path中
L:\myweb\database\pgsql\pgsql\bin
复制代码
二.修改安装目录里的 data里的pg_hba.conf 文件
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all scram-sha-256
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all scram-sha-256
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
复制代码
改成
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the