2012-05-25 5 views
3

포스트 그레스를 실행할 수 있도록 su을 Mac의 postgres 사용자에게 보내고 싶습니다.Mac에서 postgres 사용자로 전환

내가 뭘 잘못하고 있니?

delirium:~ anna$ sudo su postgres 
delirium:~ anna$ 

아무런 일도 일어나지 않습니다. 내가 su하기 위해이를하려고하면 또한 오류 얻을

delirium:~ anna$ sudo pg_ctl -D /usr/local/var/postgres -l  
/usr/local/var/postgres/server.log startpg_ctl: cannot be run as root 
Please log in (using, e.g., "su") as the (unprivileged) user that will 
own the server process. 

:

delirium:~ anna$ sudo su - postgres 
su: no directory 
delirium:~ anna$ 

내가 대신 할 수있는 일은 무엇인가를 내가 포스트 그레스를 실행하려고하면, 나는 다음과 같은 무언가를 얻을? 나는 꽤 포스트그레스 사용자가 존재한다고 확신한다.

답변

11

로그인 쉘이없는 postgres 사용자와 일치합니다. Try sudo -u postgres bash

0

PostgreSQL은 Mountain Lion의 App Store를 통해 제공되는 Server.app에 통합되어 있습니다. /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist

당신은 할 수 sudo는 :

이 파일을 것

sudo -u _postgres psql template1 

또는 연결 :

psql -h localhost -U _postgres postgres