Score:0

Getting could not connect to server: Connection refused Is the server running on host "localhost" and accepting TCP/IP connections on port 5432

us flag

I have Postgres 13 and pgAdmin installed on my Windows machine. It worked for like ~six month, until I hat do restart my machine. After restarting the computer (which I had not done because there was an update), I am trying to connect to Postgres via pgAdmin as always and I get this

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?

Some answeres suggest, to edit the postgresql.conf file which I a) do not find in my postgres installation and b) I think is not the correct solution for me because it worked without any problem until I restarted my machine.

Why is that? It feels like postgres is not starting? Although this is a wild guess... I went to Control Panel->Administrator Tools->Services and found out Postgres' service name which is postgresql-x64-13 - PostgreSQL Server 13. When I try

runas /user:Administrator cmd

and then

net start postgresql-x64-13 - PostgreSQL Server 13

I get

System Error 5. Access Denied.

This is driving me nuts...

us flag
Rob
The error says it all already: it appears that your Postgres database server has not been started, which is why you can't connect from pgAdmin. You may want to look at https://stackoverflow.com/questions/36629963/how-can-i-start-postgresql-on-windows - maybe start with `net start postgresql-x64-13`
us flag
Rob
Use "run as" but that is the limit of my Windows knowledge
Chrissl avatar
us flag
Ahhh. finally. Type `services.msc`, let the Pop Up open and search for `Postgres` there. Then, start/top the service there. Make sure to restart `pgAdmin` after doing this...
Score:0
us flag

As Rob pointed out (and as I assumed): Postgres database server has not been started (yet).

To start it manually type services.msc in i.e. 'PowerShell`, let the Pop Up open and search for Postgres there. Then, start/top the service there. Make sure to restart pgAdmin after doing this...

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.