Windows 8.1上的PostgreSQL安装 - 数据库集群初始化失败

时间:2017-04-16 01:04:50

标签: database windows postgresql windows-8.1 postgis

我试图通过EnterpriseDB.com的安装包在我的计算机上安装PostgreSQL 9.6.2。每当我在最后得到这个错误时:

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 Pro编写的,所以我不得不做一些不同的事情 - 比如compmgmt.msc不包含任何关于用户和组的内容,所以我去了lusrmgr.msc - 但它对我说,它不能用于我的Windows版本(我可能需要专业版)。所以我通过设置创建了新用户,通过控制面板授予他管理权限,并尝试通过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的每个子文件夹都是一样的。我仍然试图将安装重新运行到文章中建议的相同文件夹中,但没有,仍然是同样的错误。

我包括install-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.

此时此刻,我花了几个小时才完成这项工作,但我的想法已经不多了。任何帮助将不胜感激。非常感谢提前。

2 个答案:

答案 0 :(得分:1)

之前我遇到了同样的问题,对我来说,解决方法是在通常位置安装postgresql(“C:\ Program Files”),但是另一个驱动器中的数据可以被计算机上的所有用户访问

答案 1 :(得分:0)

在C:\ Postgresql中安装Postgresql。它应该工作。

相关问题