简体   繁体   中英

Accessing WSL postgresql server from Windows PGadmin

I am running postgresql in WSL Ubuntu on windows. Everything is up to speed, my data is loaded and I wish to access the database through some graphical interface. I was thinking pgadmin4.

Is it possible to accomplish this through a windows install of pgadmin4? I installed pgadmin4 on windows and tried to connect the traditional way in the GUI through localhost but am not getting a connection. I figure there may be a special method here.

For everyone else stumbling across this: The best way to do this (that I know of) is to SSH into your local WSL and then configure the SSH in pgAdmin to that.

I have yet to figure out, how to use this remotely.

There is no special way needed, you should be able to get a connection. Just like your dev http ports are exposed to your browser on Windows, your db port should too.

I had to manually add localhost to pg admin though which is a bit weird.

Make sure your db service is up and running on Ubuntu, sometimes the db service is killed for no reason.

To see if your PostgresSQL service is up or not:

sudo service postgresql status

If it's not, start the service:

sudo service postgresql start

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