【发布时间】:2018-02-07 16:00:13
【问题描述】:
我在我的 Mac(High Sierra,10.13.3)上运行 Homebrew 安装的 Postgres 版本 9.6.3,今天早上我发现 Postgres 有一些问题。昨晚还好好的,然后我把电脑睡了……今天早上我把它叫醒并尝试运行凤凰应用程序时,我得到了
[error] Postgrex.Protocol (#PID<0.306.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
运行 psql 返回
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
所以看起来服务器可能已经停止了......但是,运行我的别名 pg-start,转换为 launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist 返回
/usr/local/Cellar/postgresql/9.6.3/homebrew.mxcl.postgresql.plist: service already loaded
所以这很令人困惑,因为似乎一个命令表明 Postgres 没有运行,而另一个表明它正在运行。
我无法确定,但我可能在昨晚让计算机进入睡眠状态之前停止了服务器,实际上我通常不会这样做...我的 pg-stop 别名是 launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
虽然我不明白为什么这会导致问题,但这是唯一让我印象深刻的事情是我可能做过的“不同”的事情。
我已尝试重新启动我的机器,但问题仍然存在。我对调试此类问题的经验并不丰富,因此非常感谢任何指导或建议。
【问题讨论】:
标签: postgresql homebrew