2012-09-03 60 views
0

我在osx上,並且在創建用戶postgresql時遇到問題。 當我寫的命令:postgresql在osx上創建用戶

createuser myapp -s 

我得到以下錯誤:

could not connect to database postgres: could not connect to server: No such file or directory 
Is the server running locally and accepting 
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? 

我不知道,如果它只是PATH目錄問題。

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting 

我安裝了這個解決方案的PostgreSQL:http://tammersaleh.com/posts/installing-postgresql-for-rails-3-1-on-lion

感謝您的幫助和抱歉,我的英語不好。

回答

1

你確定postgres服務器正在運行嗎? (使用「ps ax | grep postgres」)。它打開了一個TCP端口(默認爲5432)?這是unix套接字「/var/pgsql_socket/.s.PGSQL.5432」可用,並且您是否有權讀取/寫入它?

此外,你可能要檢查的地方Postgres的服務器本身的權限配置pg_hba.conf文件。