惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
博客园 - 司徒正美
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
A
About on SuperTechFans
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
博客园 - 聂微东

博客园 - 冰封的心

华为欧拉安装.net10 设置word中第一页不显示页码,第二页页码从1开始 阿里云OSS图片生成缩略图和获取视频的封面方法 nginx中部署vue3注意事项 Windows下同版本的postgresql到入data/base目录下的数据库 Dapper添加postgresql分区表错误处理 nginx更新证书 SoybeanAdmin修改 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND 升级vite至最新版 JwtBearerEvents的订阅事件 .net 获取application/json参数 强制覆盖本地代码(与git远程仓库保持一致) JetBrains Resharper关闭行间自动补全 Postgresql序列操作 解决postgres数据库remaining connection slots are reserved for non-replication superuser connectio postgresql重置序列和自增主键 在C#中使用 CancellationToken 处理异步任务 电话脱敏SQL写法
pgsql:connection failed: connection to server at “::1“, ...
冰封的心 · 2025-07-18 · via 博客园 - 冰封的心

psql: 错误: 连接到"127.0.0.1"上的服务器,端口5432失败:致命错误: 用户 "postgres" Password 认证失败

密码不对,需要重置密码

一.先确保环境变量配置正确
path中

C:\Program Files\PostgreSQL\17\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
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust

三.ctrl + shift + Esc 找到postgresql-x64-17 重新运行服务

四.运行sql shell(psql)
4.1 连接数据库
psql -U postgres
AI写代码
4.2 修改密码
ALTER USER postgres PASSWORD 'new_password';
AI写代码
五.打开pgAdmin并输入新密码


六.把第二步的东西改回去,重启服务
————————————————

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/qq_53479087/article/details/143277503