postgretsql文件不可用后卸载安装出现的问题

在 Windows 10 上安装 PostgreSQL 时出错:Warning:Problem running post-install step. Installation may not complete correctly Failed to start the database server.

卸载安装后出现该问题。
解决参考:http://www.manongjc.com/detail/15-veetuzxebmqdiho.html
操作流程:
手动创建 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-10.12-1-windows-x64.exe
  1. 从 Administrators 用户组中移除 postgres 用户
net localgroup administrators postgres /delete

猜你喜欢

转载自www.cnblogs.com/yuan116/p/13401291.html