Postgres无法连接到Unix域套接字5432上的服务器 [英] Postgres cannot connect to server on Unix domain socket 5432

查看:2072
本文介绍了Postgres无法连接到Unix域套接字5432上的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Postgres 9.2.2,当我尝试启动rails服务器或运行 psql

Using Postgres 9.2.2, I keep getting this error when I try to start up rails server or run 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_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

服务器启动时,但是当我去检查进程,没有postgres进程正在运行

says server starting, but when I go to check processes, no postgres process is running

我的路径是正确的

$ which psql
/usr/local/bin/psql
$ which pg_ctl
/usr/local/bin/pg_ctl

如果我运行这个命令:

initdb /usr/local/var/postgres -E utf8

它将连接到套接字....但它也需要我删除我的数据库,这是非常令人沮丧。

It will connect to the socket.... but it also requires me to remove my databases, which is pretty frustrating. This seems happens every time I restart.

使用


  • Postgres 9.2.2

  • Brew

  • OSX Mountain Lion

在堆栈溢出发现类似的线程,但没有解决方案似乎工作。

I found similar threads on stack overflow but none of the solutions seemed to work.

推荐答案

我刚刚安装Postgres.app由Heroku。没有更多的麻烦问题。

Screw it. I just installed Postgres.app by Heroku. No more messy issues.

这篇关于Postgres无法连接到Unix域套接字5432上的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆