I have a postgres server running on WSL2 and I am accessing it via PgAdmin (v5 and v4). Until today everything worked fine, but now I keep getting an error message when trying to connect from PgAdmin:
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?
These are the server settings in PgAdmin:
Host name/address: 127.0.0.1
Port: 5432
I have checked that postgres is running on port 5432 in WSL2 and listen_adresses
is set to '*'
in postgresql.conf
The weirdest part is that I have a NestJS app connected to the same database and it works without any errors, also donwloaded a VS Code extension that can establish connection to a postgres server and connected successfully with the credentials listed above.
So what could the problem be? Is PgAdmin bugging out?
EDIT: Restarted WSL2 and it works...