2017-03-01 74 views
0

我是新來的postgres,我通過下載postgres應用程序安裝它。但是我不得不刪除該應用程序,而現在由於某種原因後重新安裝好幾次,當我試圖通過單擊「開始」執行Postgres的獲取:Postgres應用程序錯誤數據目錄在使用

There is already a PostgreSQL server running in this data directory 

所以,我其實不知道該怎麼辦處這點。我搜索瞭如何完全刪除postgres,但由於我已經通過下載.dmg文件進行安裝,我不知道除了刪除應用程序文件夾中的應用程序並再次安裝dmg文件還有什麼更多。我已經找到了一些關於卸載postgres的說明,但他們都是關於使用brew和sudo命令,我不認爲它適用於我的情況(因爲我沒有使用pip install或brew install進行安裝)。

我已經重新安裝了幾次,但仍然得到相同的消息,已經有PostgreSQL服務器在運行。我怎樣才能解決這個問題?

我正在使用Mac OS Sierra 10.12.2。

回答

0

從故障排除指南: https://postgresapp.com/documentation/troubleshooting.html

已經有這個數據目錄中運行PostgreSQL服務器

,如果你已經配置Postgres.app使用數據目錄中就會發生這種情況這由另一個PostgreSQL安裝使用。 在啓動Postgres.app之前停止其他服務器。 一般來說,不建議只使用由其他版本的PostgreSQL創建的數據目錄,因爲它可能配置不同。

如果你想知道如何停止正在運行的其他Postgres的服務器,應該有在頂部的Mac吧一個小圖標: enter image description here

如果是有,只需單擊退出,它應該停下來。

此外,重新啓動計算機通常會阻止它。

否則,你可以嘗試:

$ ps ux | grep Postgres 
scott 13272 0.0 0.0 2612628 304 ?? S 28Jan17 0:24.19 /Applications/Postgres.app/Contents/Versions/9.5/bin/postgres -D /Users/scott/Library/Application Support/Postgres/var-9.5 -p 5432 
scott 13268 0.0 0.1 2561100 10808 ?? S 28Jan17 0:10.94 /Applications/Postgres.app/Contents/MacOS/Postgres 
scott 75423 0.0 0.0 2434840 780 s011 S+ 9:44PM 0:00.00 grep Postgres 

(這裏第二列,kill 13268)在PID運行殺應該停止。

相關問題