I've installed Postgres on Google Compute engine. I can create users, schemas and tables. I can connect to the Google Compute engine with PyCharm, remote configuration. But I can't connect DataGrip to the Postgres.
It looks like the Posgres port is open (port 5432):
...@instance-2:~$ netstat -ntpl
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:5432 :::* LISTEN -
It looks like the connection is getting blocked. when trying telnet
telnet <GCP Compute engine IP> 5432
was not successful
tried using "SSH Tunnel" in DataGrip. while the SSH Tunnel connects well, I still can't connect to the Postgres
Can someone advice how to make sure that the google cloud settings do not block connection or advice how to properly set the connection? Thanks
There was a suggestion to edit the "pg_hba.conf". From what I understand I need to add
my specific IP. Would I need to change it every time I change working location?
Other suggestions?