Reputation: 98
When starting postgres, I get the following error:
postgresql application server could not be contacted.
When running as administrator the error is "solved", but the application opens in another port - sometimes it opens in 50142, 51120 and others in 50859 -. And when it opens on another port (like the ones previously said), it asks for the password to connect to the server and I get this error:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
Info:
Solutions already tried:
I would like to know how to avoid this error when starting the application and always opening on a specific port.
Upvotes: 4
Views: 24757
Reputation: 1374
Here is how I fixed this issue on Windows 10:
C:\Users\%USERNAME%\AppData\Roaming\pgAdmin
(please note AppData is a hidden folder, to find it ,go to C:\Users%USERNAME%, go to View tab on top panel of file explorer > Click Options > click change folder and search options > View tab >in Advance options click show hidden files, folders and drives, click OK, this will display the AppData folder)C:\Program Files\PostgreSQL\9.6\bin
(To access environment variables: Control Panel > System and security > System or right click on PC, then > Advance system settings > Environment variables > System variables > Path > New > add the copied path)Upvotes: 1
Reputation: 1
Nothing in this page really helped me so. If it doesnt work for you, as for me:
Upvotes: 0
Reputation: 1
If the above solutions do not work, you will also need to delete all files in the TMP folder.
Windows+r : %tmp%
Upvotes: 0
Reputation: 51
I finally got the right solution after 3 days of tries, this was insane, some answers above was correct at least not in my case but if you running to the same problem I had, I suggested following these steps even though some answers was very clear and helpful regarding deleting the folders inside the pgAdmin folder but not all the time and it depends. So here are the steps to follow:
Upvotes: 5
Reputation: 618
Simply locate AppData\Roaming\pgAdmin, delete the pgAdmin folder and try to start pgAdmin again... It should work
Upvotes: 9
Reputation: 74
This error is happening because you haven't started the ppgadmin server. For pgadmin3 we don't need to do this thing because pgadmin3 was an application but for pgadmin4 they have build web interface in a specific port. So before starting pgadmin4 in browser you have to start the server. In python we just download the pgadmin4 package and after activating the venv we run the pgadmin server file. I would suggest you to try for the same.
Upvotes: 1