微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在 Windows 10 上安装 PostgreSQL 时出错:Warning:Problem running post-install step. Installation may not comp

错误信息

Warning
Problem running post-install step. Installation may not complete correctly
Failed to start the database server.

解决方

方案 1(推荐)

安装 Postgresql 到 WSL 上,参考 https://gist.github.com/michaeltreat/40a2f444d8ff6c89af958733448da093

方案 2

手动创建 postgres 用户,然后执行安装操作。具体步骤如下:

  1. 删除已经安装的 Postgresql删除安装目录的文件

  2. 检查是否有 postgres 用户,如果有,则删除 postgres 用户。或者执行下面的脚本直接删除

net user postgres /delete
  1. 创建 postgres 用户,并加入到 Administrators 和 power user 组
net user /add postgres <password>

net localgroup administrators postgres /add

net localgroup "power users" postgres /add
  1. 使用 postgres 用户运行 cmd.exe
runas /use:postgres cmd.exe
  1. 执行安装
.\postgresql-12.x.x-windows-x64.exe
  1. 从 Administrators 用户组中移除 postgres 用户
net localgroup administrators postgres /delete

参考

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐