问题
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