简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM