2

I've just updated pgAdmin to version 4.23 and PostgreSQL to version 12. I've also deleted all previous databases and pgAdmin installations. So it should have been a clean install (I've also cleaned up all the remains of previous versions).

Now when I'm attempting to connect to the local database server I get this before I can even type my password:

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

The service is running, I can use command line tool and it responds correctly but I can't use pgAdmin for some reason.

>psql -V
psql (PostgreSQL) 12.3
1
  • Change your listen_address in` postgresql.conf ` and pg_hba.conf
    – Thirumal
    Commented Aug 17, 2020 at 15:40

2 Answers 2

2

A duplicate of your question

PostgreSQL database service

Look through this thread as it states multiple solutions

https://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu

1
  • most of them are about changing a password or changing pg_hba.conf file. I tried that before the re-installation as well as after and it does absolutely nothing. At least, during re-installation it created postgres user and I was able to give it a password. Now I can log on and manually do things with the command line tool. But not with pgAdmin, and that's really frustrating. Commented Aug 17, 2020 at 15:54
1

To access PostgreSQL over the network

Change listen_address localhost to * in file /etc/postgresql/{version_number}/main/postgresql.conf

# - Connection Settings - 
listen_addresses = '*'          # what IP address(es) to listen on;     

Changes in pg_hba.conf

Add the following line in # IPv4 local connections:

host    all             all             0.0.0.0/0               md5

and comment

#host    all             all             127.0.0.1/32            md5
3
  • did absolutely nothing. Commented Aug 17, 2020 at 16:00
  • You need to restart the database.
    – Thirumal
    Commented Aug 18, 2020 at 0:43
  • how do I do that?.. I have stopped the service before and restarted it after making changes to the file. Is there another way? Commented Aug 19, 2020 at 14:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.