psql登录远程的服务器端

本文记录了一次尝试从Windows系统通过psql客户端连接到远程PostgreSQL数据库的过程,并遇到了连接被拒绝、认证失败等问题。文中详细展示了错误信息及可能的原因,包括服务器未运行或配置不当、用户权限不足等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Microsoft Windows [版本 10.0.16299.309]
(c) 2017 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>psql -h 192.168.80.148 -p 5532 -d postgres
psql: 无法联接到服务器: Connection refused (0x0000274D/10061)
        服务器是否在主机 "192.168.80.148" 上运行并且准备接受在端口
5532 上的 TCP/IP 联接?

C:\Users\Administrator>psql -h 192.168.80.148 -p 5532 -d postgres
psql: FATAL:  no pg_hba.conf entry for host "192.168.80.1", user "Administrator", database "postgres" ---->注意此处的user "Administrator"

C:\Users\Administrator>psql -h 192.168.80.148 -p 5532 -d postgres
psql: FATAL:  no pg_hba.conf entry for host "192.168.80.1", user "Administrator", database "postgres"

C:\Users\Administrator>psql -h 192.168.80.148 -p 5532 -d postgres
口令:
psql: FATAL:  password authentication failed for user "Administrator"

C:\Users\Administrator>psql -h 192.168.80.148 -p 5532 -d postgres -U pg102
用户 pg102 的口令:
psql: FATAL:  password authentication failed for user "pg102"

C:\Users\Administrator>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值