Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

PostgreSQL: The database cluster initialization failed

wpadmin~December 9, 2019 /System Management

PostgreSQL: The database cluster initialization failed

说明

在 Winodws 环境下删除并重新安装 PostgreSQL 时,有时会出现以下错误信息。

The database cluster initialization failed

解决方法

I had the same issue installing 9.1.4 on Windows 7. I managed to find a solution online that worked.

The steps I followed are:

  1. Uninstall PostgreSQL
  2. Delete the postgres user if it still exists.
    net user postgres /delete
  3. Create the postgres user with a password you can remember
    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.1.4-1-windows.exe

    This should run the installation successfully.

  8. Remove the postgres user from the Administrators group.

    net localgroup administrators postgres /delete

参考资料

查看 Windows 系统的 System locale
https://java.com/en/download/help/locale.xml

PostgreSQL: The database cluster initialization failed
https://dba.stackexchange.com/a/22149

Leave a Reply

Your email address will not be published. Required fields are marked *