在Windows 10中安装PostgreSQL时出现的问题

4
当我尝试在Windows 10 (64位) 上安装PostgreSQL时,出现以下提示:
'未能将SQL模块加载到数据库群集中'
以及
'运行后安装设置时出现问题'。

如果您以管理员身份安装了PostgreSQL,请提供一些澄清。 - iLuvLogix
3个回答

8

您是否以管理员权限安装了PostgreSQL?

这可能是由于权限问题,您可以尝试:

  • 创建一个名为postgres的新用户账户

  • 将新账户添加到AdministratorsPower Users组中

  • 重新启动计算机

  • postgres用户身份运行命令提示符,使用命令:runas /user:postgres cmd.exe

  • postgres命令窗口运行安装程序

  • 删除postgres用户账户和用户目录

另一种选择是:

  1. Uninstall PostgreSQL

  2. Delete the postgres user if it still exists.

     net user postgres /delete
    
  3. Create the postgres user with a password

     net user /add postgres <password>
    
  4. Add the postgres user to the Administrators group

     net localgroup administrators postgres /add
    

5a. 将postgres用户添加到Power Users组中

    net localgroup "power users" postgres /add

5b. 将postgres用户添加到管理员的本地组中

    net localgroup Administrators postgres /add
  1. Run a command window as the postgres user

     runas /user:postgres cmd.exe
    
  2. Run the install file from within the command window.

     C:\Download\postgresql-9.6.12-windows.exe // or whatever version you are using
    

    This should run the installation successfully.

  3. Remove the postgres user from the Administrators group.

     net localgroup administrators postgres /delete
    

如@Imraan在DBA中所提到的 -> 链接

针对@Youssef的评论进行编辑:

根据版本和场景的不同,用户postgres需要添加到管理员的localgroup而不是power users

来自超级用户SE的有关power-users的简要概述:

注:在Windows 7及以上版本中,Power Users仅用于遗留目的,并且与普通用户相同,除非管理员明确向该组添加了额外的权限。

Power-users可以执行以下操作:

  • 运行传统应用程序,以及 Windows 2000 或 Windows XP 专业认证的应用程序。

  • 安装不修改操作系统文件或安装系统服务的程序。

  • 自定义系统范围内的资源,包括打印机、日期、时间、电源选项和其他控制面板资源。

  • 创建和管理本地用户帐户和组。

  • 停止和启动未默认启动的系统服务。

  • Power Users无权将自己添加到Administrators组。

  • Power Users无权访问NTFS卷上其他用户的数据,除非这些用户授予他们权限。


1
我不得不将Postgres添加到管理员本地组,而不是Power Users。 - Youssef AbouEgla

0
对我来说,我所需要做的就是以管理员身份运行安装程序enter image description here

0

如果之前的答案没有帮到你,请检查你输入的密码。我曾经遇到过同样的问题,就像this post里提到的那样,只需要输入一个字母数字混合的密码,就可以顺利完成安装。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接