postgresql 安装失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11656410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
postgresql installation failed
提问by shin
I tried to install postgresql 8.4 in my windows 7 (64 bit). But it fails with following messages in log
我试图在我的 Windows 7(64 位)中安装 postgresql 8.4。但它失败并在日志中显示以下消息
Initialising the database cluster (this may take a few minutes)... Executing cscript //NoLogo "C:\PostgreSQL.4/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\PostgreSQL.4" "C:\PostgreSQL\data" 5432 "DEFAULT" Script exit code: 1 Script output: CScript Error: Can't find script engine "VBScript" for script "C:\PostgreSQL.4\installer\server\initcluster.vbs". Script stderr: Program ended with an error exit code Error running cscript //NoLogo "C:\PostgreSQL.4/installer/server/initcluster.vbs" "postgres" "postgres" "****" "C:\PostgreSQL.4" "C:\PostgreSQL\data" 5432 "DEFAULT" : Program ended with an error exit code Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed. Creating Uninstaller Creating uninstaller 25% Creating uninstaller 50% Creating uninstaller 75%
I have googled about this and run the command 'regsvr32 vbscript.dll' and it shows the message 'DllRegisterServer in vbscript.dll is succeeded', but it haven't solved my issue.
我在谷歌上搜索过这个并运行命令“regsvr32 vbscript.dll”,它显示消息“vbscript.dll 中的 DllRegisterServer 成功”,但它没有解决我的问题。
Also I set the default value for {B54F3741-5B07-11cf-A4B0-00AA004A55E8} in registry to the file path of vbscript.dll, but it also haven't solved my issue.
另外我将注册表中的{B54F3741-5B07-11cf-A4B0-00AA004A55E8}的默认值设置为vbscript.dll的文件路径,但它也没有解决我的问题。
How to fix this issue?
如何解决这个问题?
回答by shin
Following link solve my issue
以下链接解决了我的问题
The article text:
文章正文:
I'll keep this one short and sweet. For those of you that have tried to install PostgreSQL (mine was 8.3.7-1) on Windows Vista and got the error Database Cluster Initialisation Failed error at the end of the install, read this.
The problem is that Vista has some safety features associated with setting permissions on the Program Files folder. Basically, even if you are an admin, you can't change permissions on some folders like Program Files and Windows folder itself. This causes initdb to be unable to create some folders and the database cluster. What this means for you is that you need to install PostgreSQL in another folder that is not inside Program Files.
By the way, if you have forgotten your Postgres account password while installing the first time, just open a Command Prompt in Vista (If you don't know how, Google for it). Then type the command “net user”. You will see a list of users on your computer. Find Postgre's account. It's usually “postgres“. Then you need to change its password by typing “net user postgres new_password” where new_password is… well, a new password for the account. You will be needing that postgres account during install. You will need admin privileges to do this change however.
Firstly, uninstall any failed installations. Use the Control Panel or the PostgreSQL installer in the install folder.
During the install, you will be prompted to choose where you want to install the program. Just select a location in another place. Like “C:\PostgreSQL” or something similar. It may even be on your desktop. But not inside Program Files. Not inside Windows folder. However, it's not as easy. Bear with me.
After the install, you will still see that darned error message (or something like non-fatal error occured). Do not despair! (For Windows Power Users, we are just assigning Full Control permission to Postgres account on the new PostgreSQL install folder). For other users, read on if you don't know how to do it.
Go to where you just installed PostgreSQL. In this case, the C: drive. There, right-click on the folder (usually called PostgreSQL), and go to Properties – Security tab. Click on the Edit button. You will now see some usernames and other stuff. Click on the Add button. In the “Enter the object names to select” box, enter “postgres” and press Check. Postgres' user account should appear there. Click on Ok.
Now from the “Group or Usernames” box, select the Postgres account. In the window below, with lots of checkboxes, assign permission “Full Control” in the Allow Column to it. Note, if you don't want to allow full control, just give it read/write. But I just went ahead and gave it Full Control. (I was tired and annoyed. The “World's most advanced open source database” had failed to install!). Click on Ok and wait a bit for permissions to be applied.
Then, just do a re-install. Do not uninstall anything. Just run the setup again. It'll say that a PostgreSQL install folder already exists and other stuff. Just click on Next until the install finishes. If you see “file cannot be copied” errors, click on the “ignore” button when needed.
That's it. PostgreSQL should be up and running on Vista now. Hope it works for you too as it did for me, and that my guide is helpful to anybody. If it works, or if you have other solutions, let us know. Thanks for reading! :)
我会保持这个简短而甜蜜的。对于那些尝试在 Windows Vista 上安装 PostgreSQL(我的是 8.3.7-1)并在安装结束时收到错误 Database Cluster Initialisation Failed 错误的人,请阅读本文。
问题是 Vista 有一些与设置 Program Files 文件夹权限相关的安全功能。基本上,即使您是管理员,也无法更改某些文件夹(如 Program Files 和 Windows 文件夹本身)的权限。这会导致 initdb 无法创建某些文件夹和数据库集群。这对您来说意味着您需要将 PostgreSQL 安装在另一个不在 Program Files 中的文件夹中。
顺便说一句,如果您在第一次安装时忘记了您的 Postgres 帐户密码,只需在 Vista 中打开一个命令提示符(如果您不知道如何,请谷歌搜索)。然后输入命令“net user”。您将看到计算机上的用户列表。找到 Postgre 的帐户。它通常是“postgres”。然后您需要通过键入“net user postgres new_password”来更改其密码,其中 new_password 是……好吧,该帐户的新密码。在安装过程中您将需要该 postgres 帐户。但是,您将需要管理员权限才能进行此更改。
首先,卸载所有失败的安装。使用安装文件夹中的控制面板或 PostgreSQL 安装程序。
在安装过程中,系统会提示您选择要安装程序的位置。只需在另一个地方选择一个位置。像“C:\PostgreSQL”或类似的东西。它甚至可能在您的桌面上。但不在程序文件中。不在 Windows 文件夹中。然而,这并不容易。忍受我。
安装后,您仍然会看到该死的错误消息(或发生非致命错误之类的东西)。不要绝望!(对于 Windows 高级用户,我们只是为新 PostgreSQL 安装文件夹上的 Postgres 帐户分配完全控制权限)。对于其他用户,如果您不知道如何操作,请继续阅读。
转到您刚刚安装 PostgreSQL 的位置。在这种情况下,C: 驱动器。在那里,右键单击文件夹(通常称为 PostgreSQL),然后转到属性 - 安全选项卡。单击编辑按钮。您现在将看到一些用户名和其他内容。单击添加按钮。在“输入要选择的对象名称”框中,输入“postgres”并按检查。Postgres 的用户帐户应该出现在那里。单击确定。
现在从“组或用户名”框中,选择 Postgres 帐户。在下面的窗口中,有很多复选框,在允许列中为其分配“完全控制”权限。请注意,如果您不想允许完全控制,只需给它读/写即可。但我只是继续并给了它完全控制权。(我又累又生气。“世界上最先进的开源数据库”安装失败!)。单击“确定”并稍等片刻以应用权限。
然后,只需重新安装即可。不要卸载任何东西。只需再次运行安装程序。它会说 PostgreSQL 安装文件夹已经存在和其他东西。只需单击下一步直到安装完成。如果您看到“文件无法复制”错误,请在需要时单击“忽略”按钮。
就是这样。PostgreSQL 现在应该可以在 Vista 上启动并运行了。希望它对你也有用,就像对我一样,我的指南对任何人都有帮助。如果它有效,或者您有其他解决方案,请告诉我们。谢谢阅读!:)
回答by Susana Gb
I got the same result installing "postgresql-9.2.3-1-windows-x64.exe
" on Windows 7 Enterprise
and the problem get solved when I change the installation path.
我postgresql-9.2.3-1-windows-x64.exe
在 Windows 7 Enterprise 上安装“ ”得到了相同的结果,当我更改安装路径时问题得到解决。
Try to install into "c:\postgresql
" instead of "c:\program files\Postgresql
"
尝试安装到“ c:\postgresql
”而不是“ c:\program files\Postgresql
”
Good luck
祝你好运
回答by Justinas Saldukas
For me the problem was that PATH
variable did not have C:\Windows\system32
and so it did not find ICACLS
command to change folder permissions. So the solution is to add C:\Windows\system32
to system PATH
variable (if it does not contain it already):
对我来说,问题是PATH
变量没有C:\Windows\system32
,所以它没有找到ICACLS
更改文件夹权限的命令。所以解决方案是添加C:\Windows\system32
到系统PATH
变量(如果它不包含它):
- Control Panel -> System -> Advanced System Settings -> Advanced -> Environment Variables
- Under "System variable" find and select "Path"
- Click "Edit..."
- Now if value does not contain path to system32 append string
;C:\Windows\system32
(or wherever your windows path is)
- 控制面板 -> 系统 -> 高级系统设置 -> 高级 -> 环境变量
- 在“系统变量”下找到并选择“路径”
- 点击“编辑...”
- 现在,如果值不包含 system32 附加字符串的路径
;C:\Windows\system32
(或 Windows 路径所在的任何位置)
回答by CosminB
I've pulled shin's link from the google cache:
我从谷歌缓存中提取了 shin 的链接:
Original link: http://www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/
原文链接:http: //www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution/
缓存链接:http://webcache.googleusercontent.com/search?q=cache:RXu-5-ZzfcgJ: www.geekscribes.net/blog/2009/04/22/postgresql-database-cluster-initialisation-failed-solution /+&cd=3&hl=ro&ct=clnk
PostgreSQL Database Cluster Initialisation Failed Solution
PostgreSQL 数据库集群初始化失败解决方法
I'll keep this one short and sweet. For those of you that have tried to install PostgreSQL (mine was 8.3.7-1) on Windows Vista and got the error Database Cluster Initialisation Failed error at the end of the install, read this.
我会保持这个简短而甜蜜的。对于那些尝试在 Windows Vista 上安装 PostgreSQL(我的是 8.3.7-1)并在安装结束时收到错误 Database Cluster Initialisation Failed 错误的人,请阅读本文。
The problem is that Vista has some safety features associated with setting permissions on the Program Files folder. Basically, even if you are an admin, you can't change permissions on some folders like Program Files and Windows folder itself. This causes initdb to be unable to create some folders and the database cluster. What this means for you is that you need to install PostgreSQL in another folder that is not inside Program Files.
问题是 Vista 有一些与设置 Program Files 文件夹权限相关的安全功能。基本上,即使您是管理员,也无法更改某些文件夹(如 Program Files 和 Windows 文件夹本身)的权限。这会导致 initdb 无法创建某些文件夹和数据库集群。这对您来说意味着您需要将 PostgreSQL 安装在另一个不在 Program Files 中的文件夹中。
By the way, if you have forgotten your Postgres account password while installing the first time, just open a Command Prompt in Vista (If you don't know how, Google for it). Then type the command “net user”. You will see a list of users on your computer. Find Postgre's account. It's usually “postgres“. Then you need to change its password by typing “net user postgres new_password” where new_password is… well, a new password for the account. You will be needing that postgres account during install. You will need admin privileges to do this change however.
顺便说一句,如果您在第一次安装时忘记了您的 Postgres 帐户密码,只需在 Vista 中打开一个命令提示符(如果您不知道如何,请谷歌搜索)。然后输入命令“net user”。您将看到计算机上的用户列表。找到 Postgre 的帐户。它通常是“postgres”。然后您需要通过键入“net user postgres new_password”来更改其密码,其中 new_password 是……好吧,该帐户的新密码。在安装过程中您将需要该 postgres 帐户。但是,您将需要管理员权限才能进行此更改。
Firstly, uninstall any failed installations. Use the Control Panel or the PostgreSQL installer in the install folder.
首先,卸载所有失败的安装。使用安装文件夹中的控制面板或 PostgreSQL 安装程序。
During the install, you will be prompted to choose where you want to install the program. Just select a location in another place. Like “C:\PostgreSQL” or something similar. It may even be on your desktop. But not inside Program Files. Not inside Windows folder. However, it's not as easy. Bear with me.
在安装过程中,系统会提示您选择要安装程序的位置。只需在另一个地方选择一个位置。像“C:\PostgreSQL”或类似的东西。它甚至可能在您的桌面上。但不在程序文件中。不在 Windows 文件夹中。然而,这并不容易。忍受我。
After the install, you will still see that darned error message (or something like non-fatal error occured). Do not despair! (For Windows Power Users, we are just assigning Full Control permission to Postgres account on the new PostgreSQL install folder). For other users, read on if you don't know how to do it.
安装后,您仍然会看到该死的错误消息(或发生非致命错误之类的东西)。不要绝望!(对于 Windows 高级用户,我们只是为新 PostgreSQL 安装文件夹上的 Postgres 帐户分配完全控制权限)。对于其他用户,如果您不知道如何操作,请继续阅读。
Go to where you just installed PostgreSQL. In this case, the C: drive. There, right-click on the folder (usually called PostgreSQL), and go to Properties – Security tab. Click on the Edit button. You will now see some usernames and other stuff. Click on the Add button. In the “Enter the object names to select” box, enter “postgres” and press Check. Postgres' user account should appear there. Click on Ok.
转到您刚刚安装 PostgreSQL 的位置。在这种情况下,C: 驱动器。在那里,右键单击文件夹(通常称为 PostgreSQL),然后转到属性 - 安全选项卡。单击编辑按钮。您现在将看到一些用户名和其他内容。单击添加按钮。在“输入要选择的对象名称”框中,输入“postgres”并按检查。Postgres 的用户帐户应该出现在那里。单击确定。
Now from the “Group or Usernames” box, select the Postgres account. In the window below, with lots of checkboxes, assign permission “Full Control” in the Allow Column to it. Note, if you don't want to allow full control, just give it read/write. But I just went ahead and gave it Full Control. (I was tired and annoyed. The “World's most advanced open source database” had failed to install!). Click on Ok and wait a bit for permissions to be applied.
现在从“组或用户名”框中,选择 Postgres 帐户。在下面的窗口中,有很多复选框,在允许列中为其分配“完全控制”权限。请注意,如果您不想允许完全控制,只需给它读/写即可。但我只是继续并给了它完全控制权。(我又累又生气。“世界上最先进的开源数据库”安装失败!)。单击“确定”并稍等片刻以应用权限。
Then, just do a re-install. Do not uninstall anything. Just run the setup again. It'll say that a PostgreSQL install folder already exists and other stuff. Just click on Next until the install finishes. If you see “file cannot be copied” errors, click on the “ignore” button when needed.
然后,只需重新安装即可。不要卸载任何东西。只需再次运行安装程序。它会说 PostgreSQL 安装文件夹已经存在和其他东西。只需单击下一步直到安装完成。如果您看到“文件无法复制”错误,请在需要时单击“忽略”按钮。
That's it. PostgreSQL should be up and running on Vista now. Hope it works for you too as it did for me, and that my guide is helpful to anybody. If it works, or if you have other solutions, let us know. Thanks for reading!
就是这样。PostgreSQL 现在应该可以在 Vista 上启动并运行了。希望它对你也有用,就像对我一样,我的指南对任何人都有帮助。如果它有效,或者您有其他解决方案,请告诉我们。谢谢阅读!
回答by Rakesh
Solution:
解决方案:
? Uninstall PostgreSQL
? 卸载 PostgreSQL
? Run command: net user postgres /delete
? 运行命令:net user postgres /delete
? Click: Control Panel -> User Accounts -> Configure advanced user profile properties -> delete all “Unknown User” instances that seem to be left from PostgreSQL installation.
? 单击:控制面板 -> 用户帐户 -> 配置高级用户配置文件属性 -> 删除似乎从 PostgreSQL 安装中留下的所有“未知用户”实例。
? Run: compmgmt.msc -> Click Local Users and Groups -> Users -> New User… -> User name: postgres, Password: postgrespass -> Create
? 运行:compmgmt.msc -> 点击本地用户和组 -> 用户 -> 新用户... -> 用户名:postgres,密码:postgrespass -> 创建
? Run: compmgmt.msc -> Click Local Users and Groups -> Users -> postgres ->Member of -> Add… -> Administrators -> OK
? 运行:compmgmt.msc -> 点击本地用户和组 -> 用户 -> postgres -> 成员 -> 添加... -> 管理员 -> 确定
? copy the PostgreSQL installer postgresql-8.4.9-1-windows.exe to C:\
? 将 PostgreSQL 安装程序 postgresql-8.4.9-1-windows.exe 复制到 C:\
? Run: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> installed successfully without errors. Checked data folder and confirmed files created successfully.
? 运行: runas /user:postgres cmd.exe -> cd \ -> postgresql-8.4.9-1-windows.exe -> 安装成功,没有错误。检查数据文件夹并确认文件已成功创建。
? Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Administrators -> Remove
? 运行:compmgmt.msc -> 本地用户和组 -> 用户 -> postgres -> 成员 -> 管理员 -> 删除
? Run: compmgmt.msc -> Local Users and Groups -> Users -> postgres -> Member of -> Add… -> Power Users -> OK
? 运行:compmgmt.msc -> 本地用户和组 -> 用户 -> postgres -> 成员 -> 添加... -> 高级用户 -> 确定
回答by Mattias Ahlholm
I had the same problem when trying to install PostgreSQL 9.3.5-3 on a Windows 7 x64 machine (not joined to a domain) in a folder, created on the root, with full access to everybody. The problem was solved by not using ? in my password, so avoid using non-English characters in your password.
尝试在 Windows 7 x64 机器(未加入域)上的文件夹中安装 PostgreSQL 9.3.5-3 时遇到了同样的问题,该文件夹是在根目录上创建的,每个人都可以完全访问。问题是通过不使用来解决的?在我的密码中,因此请避免在密码中使用非英文字符。
回答by Craig Ringer
Your Windows install is a little borked, and you will need to re-register the VBScript engine to get the installer to run.
您的 Windows 安装有点无聊,您需要重新注册 VBScript 引擎才能运行安装程序。
Edit: I'm blind, the post author had already tried this.
编辑:我瞎了,帖子作者已经试过了。
See:
看:
回答by Manoj Kalluri
The answer is very simple, move the downloaded .exe file to some other folder . for ex: c:\postgres and try to install it.
答案很简单,将下载的 .exe 文件移动到其他文件夹。例如:c:\postgres 并尝试安装它。
your issue is due to some admin privilege issues
您的问题是由于一些管理员权限问题
回答by Wolfgang Jacques
After some struggle I came across this post. I struggled some more time and I think I finally figured it out with the help of all the invaluable input from my predecessors in this post.
经过一番挣扎,我发现了这篇文章。我又挣扎了一段时间,我想我终于在这篇文章中所有前辈的宝贵意见的帮助下弄明白了。
My case
我的情况
- It's November 2018.
- PostgreSQL 11.1 Winodws-x64 from EnterpriseDB as suggested by postgresql.org
- Tried to install on Windows 10 (both Home and Professional)
- 现在是 2018 年 11 月。
- 根据 postgresql.org 的建议,来自 EnterpriseDB 的 PostgreSQL 11.1 Winodws-x64
- 尝试在 Windows 10(家庭版和专业版)上安装
I tried several constellations and boiled down the process to this:
我尝试了几个星座并将过程归结为:
Pre-installation
预安装
- Uninstall any failed installations.
- Add a local user "postgres" (lowercase worked for me) to your computer, assign a SIMPLE password and administrative rights. Do avoid special characters at all expenses, stick with english letters (upper and lowercase) and numbers only.
- Add a folder on your computer OUTSIDEthe "C:\Program Files" or Windows folder. I chose C:\PostgreSQL
- Assign full control over the above folder to the postgres account.
- 卸载所有失败的安装。
- 将本地用户“postgres”(小写对我有用)添加到您的计算机,分配一个简单的密码和管理权限。不惜一切代价避免使用特殊字符,只使用英文字母(大写和小写)和数字。
- 增加您的计算机上文件夹以外的“C:\ Program Files文件”或Windows文件夹中。我选择了 C:\PostgreSQL
- 将上述文件夹的完全控制权分配给 postgres 帐户。
Installation
安装
- Run the installer (postgresql-11.1-1-windows-x64.exe in my case)
- use the above password and folder when prompted (not the default folder)
- 运行安装程序(在我的例子中是 postgresql-11.1-1-windows-x64.exe)
- 出现提示时使用上述密码和文件夹(不是默认文件夹)
Post-installation
安装后
- For security reasons you should now assign a proper password to the windows-user "postgres" and remove administrative rights from the account.
- Test your installation by running pgAdmin and connecting to your server. However, the password for the postgres user you need to connect to the server will still be the simple one you used earlier. You may change it within pgAdmin by selecting the postgres database left, choose Tools -> Query Tool and type
ALTER USER postgres WITH PASSWORD '4wligzo748o$%&';
or whatever. Execute with the flash symbol or F5.
- 出于安全原因,您现在应该为 windows 用户“postgres”分配一个正确的密码并从该帐户中删除管理权限。
- 通过运行 pgAdmin 并连接到您的服务器来测试您的安装。但是,您连接到服务器所需的 postgres 用户密码仍将是您之前使用的简单密码。您可以通过选择左侧的 postgres 数据库在 pgAdmin 中更改它,选择工具 -> 查询工具并键入
ALTER USER postgres WITH PASSWORD '4wligzo748o$%&';
或其他任何内容。使用闪烁符号或 F5 执行。
But maybe this is wrong altogether and you should rather run a linux vm with postgreSQL server.
但也许这完全是错误的,您应该使用 postgreSQL 服务器运行 linux vm。
回答by Frank Fox Maina
Hey guys the answer is very simple just install postgresql on another folder outside program files. it prompts a non fatal error and proceeds to with the installation...
嘿伙计们,答案很简单,只需在程序文件之外的另一个文件夹上安装 postgresql。它提示一个非致命错误并继续安装......