Mac OS X上的Postgres权限被拒绝 [英] Postgres permission denied on MAC OS X

查看:157
本文介绍了Mac OS X上的Postgres权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在跟踪ruby on rails教程,以便与postgres一起运行,但是当我尝试"rake db:create"时,出现以下错误:

I was following the ruby on rails tutorial to run with postgres but when I try the "rake db:create" I get the following error:

could not connect to server: Permission denied
    Is the server running locally and accepting
    connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

我发现这个问题发出了类似的问题,但无论如何我都无法使它起作用.

I have found this question issuing some similar problem but I couldnt make it work anyway.

升级到OSX 10.7 Lion后修复Postgresql

阅读此问题后,我已经安装了自制软件,并且路径很好,Brew医生显示路径没有错误.

I have installed homebrew after reading this question and the path is fine, brew doctor shows me no errors on path.

推荐答案

您可以尝试建立 TCP连接,而不是对您的套接字文件权限进行故障排除.将host: localhost添加到您的config/database.yml中.当然,这仅在postgres正在侦听TCP流量时才有效.默认情况下,Postgres侦听端口5432,因此netstat -an | grep 5432会告诉您是否正在侦听.

Instead of troubleshooting your socket file permissions, you could try a TCP connection. Add host: localhost to your config/database.yml. Of course, this will only work if postgres is listening for TCP traffic. Postgres listens on port 5432 by default, so netstat -an | grep 5432 will tell you if it is listening.

参考

这篇关于Mac OS X上的Postgres权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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