+2 votes
in Databases by (349k points)

I am trying to connect to PostgreSQL thru Pgadmin, but I am getting the following 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? 

I also tried to connect thru windows command line and got the following error:

psql: 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?

The problem started after rebooting my computer. How can I fix it?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

It seems that the PostgreSQL server didn't start automatically after rebooting your computer. You need to restart PostgreSQL server manually. Do the following...

1. On Windows command line, type services.msc to open the services.

2. Search for the service name like postgresql

3. Right click on the service postgresql and the click on start.

It will start your PostgreSQL server and you can connect to the database

Related questions


...