pgadmin, postgres and gogole cloud connection time out

admin

Administrator
Staff member
I followed <a href="https://cloud.google.com/community/tutorials/setting-up-postgres" rel="nofollow noreferrer">this tutorial</a>.

I managed to set up everything and do exactly as it was mentioned in the tutorial.

But when I tried to connect to it using PGADMIN 4, i get connection time and out and I was never able to fix it.

then I found <a href="https://rimina.wordpress.com/2016/03/11/databases-at-first-sight-postgresql/" rel="nofollow noreferrer">this link</a>, which has the following command:

Code:
sudo -i -u postgres
psql
\conninfo

then I cans see the following message:

Code:
You are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5432".

So I dont understand what is wrong now and when I type:
Code:
sudo nano ../../etc/postgresql/9.3/main/pg_hba.conf
to see the content of the file and I put my password, its not being accepted.

Then I restart everything by closing the window and open it again, then I can check out the file:

Code:
# If you change this first entry you will need to make sure that the
# database superuser can access the database using some other method.
# Noninteractive access to all databases is required during automatic
# maintenance (custom daily cronjobs, replication, and similar tasks).
# 
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5
# IPv4 remote connections for the tutorial:
#host     all             all             127.0.0.1/32           md5
#host     all             all             35.196.55.208/32       md5
host     all             all             all                     md5

The last 4 lines I've added to fix the problem, but nothing yet.

What am I doing wrong? I'm looking at many tutorials, and also several pages from Stack Overflow but still nothing!