【问题标题】:PostgreSQL Installation on Windows 8.1 - database cluster initialisation failedWindows 8.1 上的 PostgreSQL 安装 - 数据库集群初始化失败
【发布时间】:2017-09-11 23:07:24
【问题描述】:

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

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

我做了一些谷歌搜索并找到了一些解决这个问题的“解决方案”,但没有一个对我有用。我使用的是“普通”版 Windows 8.1,而不是“专业版”。大多数这些解决方案适用于 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 版本(我可能需要 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 的每个子文件夹都使用相同的文件夹。我仍然尝试按照文章中的建议将安装重新运行到同一文件夹中,但没有,仍然是同样的错误。

我将包含 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.

在这一点上,我已经花了几个小时来解决这个问题,但我的想法已经不多了。任何帮助将不胜感激。提前非常感谢。

【问题讨论】:

标签: database windows postgresql windows-8.1 postgis


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-03
      • 1970-01-01
      • 2022-08-24
      • 2019-07-04
      • 2021-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多