You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用pgAdmin 4连接PostgreSQL 15时反复出现Connection timeout expired错误

PostgreSQL 15连接超时问题的简易解决步骤
  • 确认PostgreSQL服务状态

    • Windows:按下Win+R输入services.msc,找到「PostgreSQL 15」服务,查看状态是否为「正在运行」。若未运行,右键点击选择「启动」。
    • macOS/Linux:打开终端执行sudo systemctl status postgresql,如果显示未运行,用sudo systemctl start postgresql启动服务。
  • 排查防火墙拦截

    • 临时关闭Windows Defender防火墙或第三方防火墙,尝试重新连接。如果能成功,给PostgreSQL添加防火墙允许规则,开放默认端口5432。
  • 核对连接参数

    • 在pgAdmin中确认主机地址为localhost或127.0.0.1,端口为5432,用户名为安装时设置的默认账号(通常是postgres),再次核对密码输入是否正确。
  • 重启PostgreSQL服务

    • Windows:在services.msc中右键点击「PostgreSQL 15」服务,选择「重启」。
    • macOS/Linux:终端执行sudo systemctl restart postgresql。
  • 调整配置文件(进阶操作)

    • 找到postgresql.conf配置文件:
      • Windows路径:C:\Program Files\PostgreSQL\15\data
      • macOS/Linux路径:/var/lib/postgresql/15/main
    • 打开文件后找到listen_addresses项,确保值为'*'或'localhost',保存后重启PostgreSQL服务。

内容的提问来源于stack exchange,提问作者MJ110398

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 11:02:34