Unable to Connect to Postgres Server Remotely - postgresql

I set up a Postgres server on my computer (windows) at home just to run some basic work when I am away from home, but I am unable to connect to it outside of my home network. I have setup my pg_hba.conf file to accept connections from my laptop and I have set listen_addresses to '*'. It works perfectly fine if my laptop is on the same network as my home computer, but if I go to any other network it fails to even recognize the connection.
Returns the following in pgAdmin4: could not connect to server: Connection timed out.
Any ideas?

Related

Connecting remotely to postgreSQL database

I'm trying to connect remotely on pgAdmin to a database hosted on a Windows 10 PC on another network from my personal PC.
Steps taken:
Changed listen_addresses = 'localhost' to listen_addresses = '*' in postgresql.conf file.
Added line host all all 0.0.0.0/0 to pg_hba.conf file.
Restarted postgresql service.
Opened port in firewall for port 5432
Tried to connect to database via pgAdmin on my PC by entering:
Host name: IPv4 address of machine database is hosted on.
Port:5432, Database: postgres, user: postgres, password: password
I can't see any error except a connection timed out error every time, but I don't know why. I've increased the connection timeout duration but still no connection. PostgreSQL service is running and I can connect to the database via pgAdmin just fine on the hosting PC.
Can anyone let me know if I'm skipping a step or anything else I need to add to the config files?
Thanks

pgAdmin 4. Unable to connect to server

I had a postgreSQL server/database working in a local area network in Windows. To have access to it through Ethernet I changed the IP in the router settings. Everything was fine. But when I came today to the office, I could not have connected to the server. Moreover, I cannot even create a localhost server on that PC. The error is "Unable to connect to server:" and nothing else. When I turn off the postgres in services it specifies the error with TCP/IP, port, etc. But not when the service is on. When connecting to the server, the pgAdmin asks for the postgres password. Endlessly, thou the password is printed correctly and the METHOD is set to trust. The reinstallation did not help.
What does this error mean? And what is the cure?

How to connect to a local postgreSQL database from a remote pc

I am pretty new to everything that is database management, remote connection etc... And I need this for a university project.
I have a local postgreSQL database on my Windows computer, which I access through localhost. What I want to do now is connect to this database using my laptop (which is in the same WLAN, don't know if that helps).
I changed the file pg_hba.conf, and added host all all 0.0.0.0/0 md5 and host all all ::0/0 md5. Also in the postgresql.conf file, there is one line listen_addresses = '*' which was the default, but as I understand it it is what it needs to be so a non-localhost can connect to the database.
How can I do this? On my laptop I tried running psql and for the server I put the IPv4 address of my PC(where the local database is stored), but it doesn't connect (Connection timed out)

Remote access to postgresql server windows 10

As the title suggest I'm trying to configure a postgresql server to be accessible remotely. I've followed many guides and viewed some of the other answers here however I'm still having trouble.
The details:
os, windows 10
postgresql version on host is 11.6
postgresql version on remote is 11.2 with anaconda install
I have changed the pg_hba.conf and postgresql.conf to allow for connections to the server.
More specifically I've added the line
host all all xxx.xx.x.0/0 trust
I can verify that the host is listening on local address 0.0.0.0:5432 via netstat.
I can ping the ip of the host from the remote, and I have set windows firewalls on the host to allow connection.
Yet I still recieve the following error when trying to access psql from the remote.
psql: could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "xxx.xx.x.144" and accepting
TCP/IP connections on port 5432?```
I had to double check the windows firewall permissions. The connection was enabled but the application was not set to allowed. It turns out a local user can enable connection but I needed the system admin to set the application executable to allowed by the windows fire wall.

Problems connecting to Postgresql server?

I am running a Postgresql server hosted on heroku as part of an app I am developing. I've been using PGAdmin as a frontend to set up my tables and also check to make sure the app is correctly writing data to the tables. When I am at home it connects fine and I can use it with no problems. It also works when I tether to my phone's WiFi hotspot. However when I am in university on the WiFi it does not connect. I get the following error:
"could not connect to server: Connection timed out (0x0000274C/10060) Is the server
running on host <MY HOSTNAME> and accepting TCP/IP connections on port 5432?"
I'm trying to troubleshoot this. I tried the obvious things like checking my hostname and port are correct (they are, because it works from home!) and checking that Pgadmin has permissions in windows firewall (it does). Not sure what to try next.
Is it likely to be that the port is blocked? I used an online port checker which reported that the port (5432) was closed, however it also says this when using my phone's wifi hotspot (which normally works, as I said). Is there another port I can use with Postgresql?
OK, it turns out the port 5432 was actually closed on my university's WiFi. I was able to request that it be opened, and everything is now working.