Lion更新删除了“ postgres”用户。如何还原? [英] Lion update removed the 'postgres' user. How to restore it?
问题描述
几个月前,我已经使用kyngchaos安装程序安装了postgres。我现在已经更新到OSX Lion,但是数据库服务器无法启动。
I've installed postgres with the kyngchaos installer a couple of months ago. I've now updated to OSX Lion, but the database server fails to start.
对kyngchaos博客的评论( http://www.kyngchaos.com/blog/2011/20110723_lion )使我看到了 postgres用户:该用户不存在不再!至少,我不能再 sudo su postgres了。因此,我认为这是服务器无法运行的原因。
A comment on kyngchaos's blog (http://www.kyngchaos.com/blog/2011/20110723_lion) made me look at the 'postgres' user: it doesn't exist anymore! At least, I can't "sudo su postgres" anymore. So I figure that's the reason my server doesn't run.
如何最好地还原该用户?
How can I best restore that user?
推荐答案
(回答自己)
最后,我唯一需要做的就是重新创建 postgres用户。事先,我列出了 / usr / local / pgsql /
的内容,并发现例如 data /
目录是由用户 101
和组 postgres
拥有。因此,我想将该postgres用户绑定到101个用户ID:
In the end, the only thing I needed to do was to re-create the "postgres" user. Beforehand, I listed the contents of /usr/local/pgsql/
and saw that for instance the data/
directory was owned by user 101
and group postgres
. So I wanted to tie that postgres user to the 101 userid:
sudo dscl . -create /Users/postgres
sudo dscl . -create /Users/postgres UniqueID 101
(然后我重新启动了Mac,因为我不知道如何手动启动该postgres服务器...;-)
(And afterwards I restarted my mac as I didn't know how to start that postgres server by hand... ;-)
这篇关于Lion更新删除了“ postgres”用户。如何还原?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!