繁体   English   中英

无法使用山狮连接到Postgres服务器

[英]can't connect to postgres server with mountain lion

搜寻Postgres和Mac 10.8的所有问题后需要帮助

我通过自制软件安装了pg(也尝试过heroku应用,但没有运气)

which psql --> /usr/local/bin/psql
psql --version --> psql (PostgreSQL) 9.2.4

启动Rails服务器时,我得到服务器Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

当我执行pg_ctl -D /usr/local/var/postgres -l logfile start我会pg_ctl -D /usr/local/var/postgres -l logfile start server starting

当我运行psql我得到Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

任何想法?

无论我的设置有什么问题,我都结束了将host: localhost添加到我的database.yml ,并成功了。 浪费了太多时间,因此现在仍然可以保留。 谢谢你的帮助。

系统中是否有用户“ postgres”?

我不知道自制酒,但也许您需要:

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data

另外,postgres用户必须对日志文件具有写权限。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM