2012-12-07 73 views
3

最近升級到Mountain Lion之後,我遇到了使用我的brewgres安裝的問題。OSX 10.8升級後postgres無法連接服務器

$ rake db:create 
>rake db:migratecould not connect to server: Connection refused 
> Is the server running on host "localhost" (::1) and accepting 
> TCP/IP connections on port 5432? 
>could not connect to server: Connection refused 
> Is the server running on host "localhost" (fe80::1) and accepting 
> TCP/IP connections on port 5432? 
>could not connect to server: Connection refused 
> Is the server running on host "localhost" (127.0.0.1) and accepting 
> TCP/IP connections on port 5432? 

在搜索周圍的interwebs之後,我還沒有找到解決此問題的方法。

我發現了一個建議的步驟來幫助識別問題,但在遵循這些步驟之後,我不確定如何理解結果或接下來要做什麼。誰能幫忙?

$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start 
>pg_ctl: another server might be running; trying to start server anyway 
>server starting 


$ pg_ctl -D /usr/local/var/postgres stop -s -m fast 
>pg_ctl: could not send stop signal (PID: 865): No such process 


$ pg_ctl status                 
>pg_ctl: no server running 


$ ps auxw | grep post 
>myuser 19037 2.6 7.7 4388248 324520 ?? S  7:30AM 19:06.02 /Applications/Postbox.app/Contents/MacOS/postbox-bin -psn_0_917728 
>myuser 54897 0.1 0.0 2432768 464 s000 R+ 1:47PM 0:00.01 grep post 


$ cat /usr/local/var/postgres/server.log 
>FATAL: lock file "postmaster.pid" already exists 
>HINT: Is another postmaster (PID 821) running in data directory "/usr/local/var/postgres"? 

歡迎提供任何可能有用的附加信息。

+0

也許這將幫助:https://gist.github.com/1877457讓我知道。 –

+0

好的,這可能是有希望的。殺怪奇怪返回失敗:沒有這樣的過程。停止也返回不能發送停止信號(PID:xxx):沒有這樣的過程。最後的選項給FATAL:數據目錄「/ usr/local/var/postgres」具有錯誤的所有權,我懷疑這可能很重要,但我不知道這應該如何表現。感謝任何建議 –

回答

2

嘗試刪除:

​​

這一次爲我工作。

+0

感謝狄龍,已經嘗試過。沒有工作:)你能否更詳細地解釋你的步驟。例如停止數據庫,刪除,重新啓動...? –

相關問題