Answer a question

I have installed pgadmin on a new windows laptop and when I try to create a new server, it says:

enter image description here

When I try to run my django app in pycharm it is giving me the same error

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?

How to solve this ?

Answers

You can configurate your newly created server to run on localhost and port 5432.

First select the “Connection” tab in the “Create-Server” window. Then, configure the connection as follows:

  • Enter your server’s IP address in the “Hostname/ Address” field. Default is localhost.

  • Specify the “Port” as “5432”.

  • Enter the name of the database in the “Database Maintenance” field.

  • Enter your username as postgres and password (use the same password you used when previously configuring the server to accept remote connections) for the database.

  • Click “Save” to apply the configuration.

NOTE You first have to install PostgreSQL on your machine and run it or run it with docker.

Logo

学AI,认准AI Studio!GPU算力,限时免费领,邀请好友解锁更多惊喜福利 >>>

更多推荐