首页 > 解决方案 > Apple MacBook Pro M1 芯片 + Postgres + Connection denied 错误

问题描述

我的 MacBook Pro M1 芯片出现以下错误

Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?

在 MacBook Air 中,我曾经通过从 /usr/local/var/postgres/postmaster.pid 目录中删除 postmater.pid 来解决此错误。

但无法在 MacBook Pro M1 BigSur OS 中找到这个 pid

标签: postgresqlapple-m1

解决方案


在 MacBook Pro M1 芯片中,您可以在以下目录中找到 postmate.pid。

/System/Volumes/Update/mnt1/opt/homebrew/var/postgres/postmaster.pid

我已将其删除并重新启动 Postgres。现在一切都在完美运行。


推荐阅读