I would like to install Rails 5/Postgres within Bash On Ubuntu On Windows and also be able to access Postgres database via PgAdmin for Windows.
Am quiet happy to install all my rails dependencies through Bash on Ubuntu on Windows, but I am aware that I can't run any standard GUI tools from Bash and was wondering if it is possible to install Rails and PostGres on the Linux Subsystem and then query my databases using the Windows version of PgAdmin
I had a look at this tutorial how-to-install-ruby-on-rails-on-windows-10-with-postgresql but it seems that he installs Postgres into windows rather then the Linux Subsystem.
I was wondering if this is the only way to go about getting all these tools working nicely together.
Basically I want my Windows installed PgAdmin to communicate to my Bash On Ubuntu On Windows Postgres DB
PgAdmin is a popular open source management and development tool which is released under PostgreSQL/Artistic license. Different types of database operations can be done easily from the browser by using this software. This software can be used on most popular operating systems.
Create connection credentials for the server such as hostname, dbname, and Postgres password then save the server settings. After this, we can use the PgAdmin 4 for database management. After server installation, we can use the query tool for database management as shown in the figure below.
The quick way to verify the installation is through the psql program. First, click the psql application to launch it. The psql command-line program will display. Second, enter all the necessary information such as the server, database, port, username, and password.
Here's what I did to connect Postgres DB installed in WSL Ubuntu from Windows pgAdmin.
sudo service postgresql start
Save password?
The answer provided by @kiatng helped me too. However, I was getting a socket not connected
error when I was trying to access the data in my tables. Through another Google search, I found I needed to change localhost to 127.0.0.1 and then I was able to access the data.
Just putting this here in case it helps someone else. I would have replied to kiatng's answer but I don't quite have enough 'reputation' yet to do so!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With