添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
腹黑的香瓜  ·  Microsoft Entra ...·  10 小时前    · 
深情的鞭炮  ·  Install .NET Runtime ...·  6 月前    · 
善良的小狗  ·  MySql.Data.MySqlClient ...·  1 年前    · 
高大的柚子  ·  freemarker ...·  2 年前    · 

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Visit Stack Exchange

Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.

Sign up to join this community

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question

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...

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 stackoverflow.com/questions/36629963/… - maybe start with net start postgresql-x64-13 – Rob May 6, 2022 at 7:00 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... – four-eyes May 6, 2022 at 7:28

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...