Is the server running on that host and accepting TCP/IP connections?

Viewed 157

I am working on a Django project as a Front-End developer. I am getting " django.db.utils.OperationalError: connection to server at "13.234.81.119", port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?"
many times when I try to run the server using the command python manage.py runserver on VS Code

Because of this, I have to restart the server, and sometimes luckily server works. I did the following things to resolve the problem:

NOTE: I am using windows 11.

1) deleted temporary files using the command %temp%

2) reinstalled psycopg 2.9.2

3) I reset the TCP/IP settings in services on my PC.

but the problem did not solve.

I am attaching the screenshots of the complete error log. Please help me to resolve the issue, I will be grateful to you

enter image description here

enter image description here

enter image description here

1 Answers

Is your Postgres running on the port you specified if not?

Go inside the bin folder in the C drive where Postgres is installed. run the following command in git bash or Command prompt:

pg_ctl.exe restart -D "<path upto data>"

Example

pg_ctl.exe restart -D  "C:\Program Files\PostgreSQL\9.6\data"
Related