How to run PostgreSQL as a service in windows?

允我心安 提交于 2019-12-04 16:31:34
chalitha geekiyanage

Problem was solved path to the data directory was wrong in windows service file.

So I delete the service file from this method:

1)Run Regedit or Regedt32.

2)Go to the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services"

3)Look for the postgreSQL service that you want delete and delete it.

4)reboot the computer.

After that open the cmd (Run as administrator) Go to the postgreSQL bin directory and run this command to create a new windows service:

pg_ctl.exe register -N "PostgreSQL" -U "NT AUTHORITY\NetworkService" -D "C:/Program Files/postgresql/pgsql/bin/pgsql/data" -w

This worked for me. Hope this will help.

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