PostgreSQL permissions issue after upgrading to OS X Lion

浪尽此生 提交于 2019-12-22 08:19:58

问题


After upgrading to Lion, I get the following error when trying to start up the Postgres server:

pg_ctl: could not open PID file "/usr/local/var/postgres/postmaster.pid": Permission denied

I also tried to re-run the initdb command, but ran into a similar problem:

initdb: could not access directory "/usr/local/var/postgres": Permission denied

If it matters, PostgreSQL was installed via Homebrew. Running brew info postgresql yields the expected results (version, summarized docs).


回答1:


Well, it turns out the solution was pretty simple. I changed the group on /usr/local/var to staff (from wheel) and changed the ownership (chown -R) to my system account (from root).

After that, postgres started up fine.

I was a little nervous changing those permissions, but the only thing in my /usr/local/var was a postgres directory, so all should be well. If you have other directories/files in /usr/local/var, maybe don't use the -R flag when chown'ing?

The Homebrew ruby installer script changes the group of /usr/local/var to staff, so that must have gotten undone when upgrading to Lion. Not sure about the ownership being root instead of my system account though...



来源:https://stackoverflow.com/questions/6834118/postgresql-permissions-issue-after-upgrading-to-os-x-lion

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