2

Hi i want to use PostgreSQL for a school project and whenever i open the server in Pg Admin i got the same issue

when i first open Pg Admin i enter the password that i entered in the installation and when i click to server(1) it requires password for user "postgres" i use the same password but it tells me:

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 1500? 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 1500?

i don't know what does it really mean .. cause i'm new to databases and servers

  • i reinstall all postgres & Pg admin : same issue
  • i restart the server in services-postgres.. : same issue

I'm using PostgreSQL-12 and Pg Admin-4 in Windows-10

image

please help !! and thank you !

11
  • You need to modify Postgresql.conf and pghba.conf file. Refer github.com/M-Thirumal/installation_guide/blob/master/PostgreSQL/… Commented Jul 11, 2020 at 14:09
  • it explain in ubuntu and i'm using windows ... it is the same thing ? Commented Jul 11, 2020 at 14:14
  • Yes “Access PostgreSQL over network” is same for all operating systems Commented Jul 11, 2020 at 14:17
  • i did the config change and listen addresses "*" but same erreur Commented Jul 11, 2020 at 14:22
  • 1
    This link here have suggestions solves for the problem. stackoverflow.com/questions/40532399/… Commented Dec 11, 2022 at 6:26

4 Answers 4

7

On windows:

  • click on windows
  • search for services
  • scroll down to postgresql
  • right-click on it and select properties
  • click on the startup type dropdown button and select automatic
  • then click start
  • this will automatically run your postgresql
Sign up to request clarification or add additional context in comments.

1 Comment

tanks @Banjoko Kazem
1

I am facing the same problem and as I edited the port to 5432 it worked. In my case, Postgres was running on 5433 and I changed it to 5432

Comments

0

Pretty sure the problem is due to this:

... accepting TCP/IP connections on port 1500

Postgres runs by default on port 5432. Try changing the port setting to 5432.

6 Comments

in the postgres config the port is by default 5432. what if i change it to 1500 ?
yeeeees !!! i change the port to 1500 and now it's working OMG i'm verry happy now :)
Why not leave it at the default port(5432) and change the port setting in the connection setting? Most Postgres clients are going look for 5432 by default and you will need to change that to 1500 for each.
well i'm just gonna use it for now for my project and then i will change it for future work
Yeah well temporary fixes often turn into permanent ones. If it where me I would make the change now to save the hassle of undoing/maintaining it in the future.
|
0

For me the issue is due to not starting a server, so you should start the server, one way to do it is to cd to postgresql bin and start it with pg_ctl, here is an example:

cd "C:\Program Files\PostgreSQL\14\bin"
pg_ctl -D "C:\Program Files\PostgreSQL\14\data" start

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.