PostgreSQL Permission denied Error on Unix domain socket “/var/pgsql_socket/.s.PGSQL.5432” - Lion Server 10.7.3 or Lion Server 10.7.4

亡梦爱人 提交于 2019-11-28 14:16:35

After continuing to search for blog posts we were able to find one that dealt with Lion 10.7.4. What I did not know that something had changed between 10.7.2 when I started writing my Rails application and now with PostgreSQL. We found the following blog post which helped me solve the problem I had for several days.

http://www.mactasia.co.uk/revisited-using-postgresql-in-lion-server

I ended up logging in as root and doing the following:

Made the following changes in /System/Library/LaunchDaemons/org.postgresql.postgres.plist

listen_addresses=127.0.0.1
unix_socket_permissions=0777

Changed the permissions of /var/psql_socket

sudo chmod 755 /private/var/pgsql_socket

Afterwards I logged out of root and logged in as I normally do as a server admin. I no longer got the permission error.

which psql will most likely show /bin/psql I'm guessing we want to call /usr/local/bin/psql

So either we change the $PATH to include /local/bin prior to /bin, which I don't think is a very good solution (security and such), or We remove /usr/bin/psql by either rm-ing (or mv-ing) the file, (and symlinking to /usr/local/bin) or uninstalling the psql client.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!