PostgreSQL cannot connect: service definition not found

半世苍凉 提交于 2021-02-11 07:14:00

问题


In Windows 10 Pro 64-bit & new installation of PostgreSQL 9.4, attempting to connect to the server in pgAdmin III results in

The service is running and the service name is correct, as seen here

I am brand new to PostgreSQL, but fwiw, I've configured a working Symfony 2.7 application to use PostgreSQL and have successfully (according to the Symfony console) created a database and its schema.

What is required to get pgAdmin to connect properly?


回答1:


It turns out that the error message is grossly misleading. There is no issue with the service definition. Instead, I learned that when logged in as a user other than the user that created the PostgreSQL installation (e.g., postgres) one needs to do this at the command prompt:

runas /user:postgres "C:\Program Files\PostgreSQL\9.4\bin\pgAdmin3.exe"

There may be a more elegant solution than making the above a cmd file. I'd like to know what that is!



来源:https://stackoverflow.com/questions/31886549/postgresql-cannot-connect-service-definition-not-found

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