Issues while installing PostgreSQL in Windows 10

元气小坏坏 提交于 2020-01-03 17:08:27

问题


When I tried to install PostgreSQL on Windows 10 (64-bit), I was getting a prompt saying:

'Failed to load SQL modules into the database cluster'

and

'problem running post-install setup'.


回答1:


Did you install postgresql with administrator-privileges?

This might be due to a privilege-issue, you can try to:

  • Create a new user account, called postgres
  • Add the new account to the Administrators and Power Users groups
  • Restart the computer

  • Run a command prompt as the postgres user, using the command:runas /user:postgres cmd.exe

  • Run the installer from the postgres command window
  • Delete the postgres user account, as well as the user directory

Another option is to:

  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
    
  5. Add the postgres user to the Power Users group

    net localgroup "power users" postgres /add
    
  6. Run a command window as the postgres user

    runas /user:postgres cmd.exe
    
  7. 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.

  8. Remove the postgres user from the Administrators group.

    net localgroup administrators postgres /delete
    

as mentioned by @Imraan on DBA -> Link



来源:https://stackoverflow.com/questions/55282696/issues-while-installing-postgresql-in-windows-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!