0

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
Lev Slinsen
  • 315
  • 1
  • 2
  • 14

2 Answers2

1

A duplicate of your question

https://stackoverflow.com/questions/4482239/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
Mahad Ansar
  • 146
  • 3
  • 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. – Lev Slinsen Aug 17 '20 at 15:54
0

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
Thirumal
  • 5,736
  • 7
  • 40
  • 79