arilwan
arilwan

Reputation: 3993

pgAdmin4: remote access to PostgreSQL server

I can access the remote PostgreSQL server in the lab from both the terminal and using pgAdmin4 when connected to same private network.

From Terminal:

PC:~$ psql -h 193.13x.xx.xx -U myusername -W dbname
#then password after prompt

Using pgAmin4:

Host name/address: 193.13x.xx.xx
Port: 5432
Maintainance database: dbname
Username: myusername
Password: *******

However, when I switched to another network eduroam, I can only connect to the remote server via the terminal, not from pgAdmin4. So it is not very easy to work away from the lab.

Is there a workaround to enable connecting via pgAdmin4?

Upvotes: 0

Views: 2243

Answers (1)

Daniel Vérité
Daniel Vérité

Reputation: 61726

I can only connect to the remote server via the terminal, not from pgAdmin4. So it is not very easy to work away from the lab. Is there a workaround to enable connecting via pgAdmin4?

Yes. The generic answer to that is: use an SSH tunnel. It's very usual when you cannot access directly a database from outside a certain network, which appears to be your case based on the error message in the comments.

If you need specific advice for pgAdmin4, consider searching for "pgadmin4 ssh tunnel", there are many tutorials available online.

Upvotes: 2

Related Questions