我試圖用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
程序問你一個問題,'/ tmp/.s.PGSQL.5432'怎麼樣?你有兩個版本的psql安裝? – Schwern 2015-02-06 06:31:49
@Schwern我該如何檢查? – 2015-02-06 06:44:38
'ls -l /tmp/.s.PGSQL.5432'來檢查臨時文件。 '哪個-a psql'來檢查多個安裝。 – Schwern 2015-02-06 06:47:00