2015-02-06 61 views
0

我試圖用home brew我的Mac上安裝PostgreSQL,當我嘗試運行命令psql我收到以下錯誤PSQL:無法連接到服務器:在Mac OSX上沒有這樣的文件或目錄

Harshas-MacBook-Pro:~ harshamv$ psql 
psql: could not connect to server: No such file or directory 
    Is the server running locally and accepting 
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"? 

看起來系統無法識別安裝。

Harshas-MacBook-Pro:~ harshamv$ locate psql | grep /bin 
/usr/local/Cellar/postgresql/9.4.0/bin/psql 
/usr/local/bin/psql 

的過程似乎運行

Harshas-MacBook-Pro:~ harshamv$ ps -aef|grep postgres 
     501 12075 11832 0 11:54AM ttys001 0:00.00 grep postgres 

而且plist文件

Harshas-MacBook-Pro:~ harshamv$ launchctl load -w /usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist 
/usr/local/Cellar/postgresql/9.4.0/homebrew.mxcl.postgresql.plist: Operation already in progress 


Harshas-MacBook-Pro:~ harshamv$ which psql 
/usr/local/bin/psql 

Harshas-MacBook-Pro:~ harshamv$ echo $PATH 
/Users/harshamv/.rvm/gems/ruby-2.1.2/bin:/Users/harshamv/.rvm/gems/[email protected]/bin:/Users/harshamv/.rvm/rubies/ruby-2.1.2/bin:/Applications/bin/php5/bin/:/Applications/Mamp/htdocs/prayag/lib/Cake/Console:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/harshamv/.rvm/bin:/usr/local/mongodb/bin 
+0

程序問你一個問題,'/ tmp/.s.PGSQL.5432'怎麼樣?你有兩個版本的psql安裝? – Schwern 2015-02-06 06:31:49

+0

@Schwern我該如何檢查? – 2015-02-06 06:44:38

+0

'ls -l /tmp/.s.PGSQL.5432'來檢查臨時文件。 '哪個-a psql'來檢查多個安裝。 – Schwern 2015-02-06 06:47:00

回答

1

你沒有運行PostgreSQL服務器。你的ps輸出只顯示你自己的ps grep。

您也可能安裝了PostgreSQL的兩個版本,並且您正在運行與錯誤關聯的psql客戶端。您可以運行which -a psql來查看PATH中的所有psql二進制文件。

The PostgreSQL Wiki has a page devoted to figuring out Homebrew problems

This answer to your exact problem may help

+0

在卸載並重新安裝它現在我得到harshamv $哪-a psql /usr/local/bin/psql – 2015-02-07 05:45:59

+0

@HarshaMV好的,你只有一個安裝。 – Schwern 2015-02-07 05:52:02

相關問題