2014-03-13 18 views
1

我試圖從命令行連接到我的Postgres服務器:如何在MacOS 10.8.5上配置PostgresSQL服務器?

$> psql 
    psql: 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"? 

我試圖運行服務器:

$>postgres 
    postgres does not know where to find the server configuration file. 
    You must specify the --config-file or -D invocation option or set the 
    PGDATA environment variable. 

任何人都可以指出我,我怎麼可以配置我的服務器所以它的作品?

回答

0

我已經解決了這個問題。實際上Mac OS 10.8.5有他自己的psql命令。所以這是一個路徑問題。如果您從MacPort安裝postgres,系統將始終引用最初的psql命令。

我建議你從brew中安裝postgres,如here所示。

你必須重新定義也PATH環境變量並導出它在你的.profile文件:

export PATH=/usr/local/bin:$PATH 
相關問題