2017-04-16 197 views
2

我試圖通過EnterpriseDB.com安裝包在我的電腦上安裝PostgreSQL 9.6.2。每次我在最後得到這個錯誤:在Windows 8.1上安裝PostgreSQL - 數據庫集羣初始化失敗

Problem running post-install step. Installation may not complete correctly 
The database cluster initialisation failed. 

我做了一些谷歌上搜索,發現了幾個「解決方案」這個問題,但他們沒有爲我工作。我使用的是Windows 8.1,即「普通」版本,而不是「Pro」版本。這些解決方案大部分都是針對Win 7或Vista的。安裝PostgreSQL的原因是使用PostGIS來創建地圖應用程序。

我想這一個 - https://cppoon.wordpress.com/2013/03/07/how-to-solve-problem-running-post-install-step-postgresql-window/

它爲Win 7專業版寫的,所以我不得不做diffrently幾件事情 - 例如COMPMGMT.MSC不包含用戶和組什麼,所以我去lusrmgr .msc - 但它對我說,它不適用於我的Windows版本(我可能需要Pro版本)。所以我通過設置創建了新用戶,通過控制面板授予他管理員權限,並嘗試按照說明書中的說明通過CMD進行安裝。那麼,沒有工作,仍然有同樣的錯誤。

然後我試了這個 - http://www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/

它適用於Windows Vista,但無論如何我都是這樣。起初,我將它安裝在Program Files(C:\ Hry \ postgres)之外的其他文件夾中,得到了同樣的錯誤。然後我嘗試在文章中創建用戶postgres,但是當我想爲文件夾分配權限時,我得到了像這樣的stm錯誤(我的Win不是英文的,所以我以最好的方式翻譯它我可以):

Error occured during attempt to use security information for: 
C:\Hry\postgres\bin 
Unable to load list of objects in the container. Access denied. 

和postgres的每個子文件夾相同。我仍然嘗試將安裝重新安裝到文章中建議的相同文件夾中,但沒有任何問題,但仍然是相同的錯誤。

我包括安裝,PostgreSQL的日誌中的最後幾行,如果它會幫助別人與查明的問題是:

Called CreateDirectory(C:\Hry\postgres\data)... 
Called CreateDirectory(C:\Hry\postgres)... 
WScript.Network initialized... 
strParentOfDataDirC:\Hry\postgres 
logged in userPETR\Petr 
Called AclCheck(C:\Hry\postgres\data) 
Called IsVistaOrNewer()... 
'winmgmts' object initialized... 
Version:6.3 
MajorVersion:6 
Executing icacls to ensure the PETR\Petr account can read the path  C:\Hry\postgres\data 
Executing batch file 'rad1F88F.bat'... 
'icacls' is not recognized as an internal or external command, 
operable program or batch file. 

Called IsVistaOrNewer()... 
'winmgmts' object initialized... 
Version:6.3 
MajorVersion:6 
Ensuring we can write to the data directory (using icacls) to PETR\Petr: 
Executing batch file 'rad1F88F.bat'... 
'icacls' is not recognized as an internal or external command, operable program or batch file. 

Failed to ensure the data directory is accessible (C:\Hry\postgres\data) 
Called Die(Failed to initialise the database cluster with initdb)... 
Failed to initialise the database cluster with initdb 

Script stderr: 
Program ended with an error exit code 

Error running cscript //NoLogo  "C:\Hry\postgres/installer/server/initcluster.vbs" "NT AUTHORITY\NetworkService"  "postgres" "****" "C:\Hry\postgres" "C:\Hry\postgres\data" 5432 "DEFAULT" 0:  Program ended with an error exit code 
Problem running post-install step. Installation may not complete correctly 
The database cluster initialisation failed. 

在這一點上,我花了幾個小時就這個問題和我正在用盡想法。任何幫助將不勝感激。首先十分感謝。

+1

如果你有一個64位系統,你可以試試,如果你有更好的bigsql運氣。可以使用gui版本https://www.bigsql.org/postgresql/installers.jsp或cli https://www.bigsql.org/package-manager.jsp。否則,通常可以通過手動調整權限,運行initdb和註冊服務來修復企業數據庫安裝失敗。 – Eelke

回答

1

我得到了同樣的問題,我的解決方案是在通常的地方安裝postgresql(「C:\ Program Files」),但在您的計算機上的所有用戶可以訪問的另一個驅動器中的數據

0

在C:\ Postgresql中安裝Postgresql。它應該工作。

+0

根本沒有描述和**它*應該*工作**使得這更像評論而不是回答。 –