在Windows的Ubuntu上通过Bash安装的Windows 10和Postgres上的PgAdmin [英] PgAdmin on Windows 10 with Postgres when installed via Bash on Ubuntu on Windows

查看:104
本文介绍了在Windows的Ubuntu上通过Bash安装的Windows 10和Postgres上的PgAdmin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows上的Ubuntu上的 Bash中安装Rails 5/Postgres. 并且还可以通过 用于Windows的PgAdmin 访问Postgres数据库 .

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.

我很高兴在Windows的Ubuntu上通过Bash通过Bash安装我的所有Rails依赖项,但是我知道我无法从Bash运行任何标准GUI工具,并且想知道是否可以在Linux上安装Rails和PostGres子系统,然后使用Windows版本的PgAdmin查询我的数据库

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.

基本上,我希望我的 Windows 安装的PgAdmin可以与我的在Windows上的Ubuntu上的Bash Postgres DB

Basically I want my Windows installed PgAdmin to communicate to my Bash On Ubuntu On Windows Postgres DB

推荐答案

这是我从Windows pgAdmin 连接安装在WSL Ubuntu中的Postgres DB的工作.

Here's what I did to connect Postgres DB installed in WSL Ubuntu from Windows pgAdmin.

  1. 在Windows中启动Ubuntu.
  2. 在Ubuntu终端中启动postgres:sudo service postgresql start
  3. 下载最新的 pgAdmin 并在Windows中安装.
  4. 启动pgAdmin,将在浏览器中打开一个新标签;单击添加新服务器链接.
  5. 在浏览器的 Create-Server 弹出窗口中:
  1. Launch Ubuntu in Windows.
  2. Start postgres in Ubuntu terminal: sudo service postgresql start
  3. Download the latest pgAdmin and install in Windows.
  4. Launch pgAdmin, a new tab in browser opens; click on Add New Server link.
  5. In the popup Create - Server window in the browser:
  1. 常规标签:我将 Name 设置为 localhost
  2. 连接选项卡:我将主机名/地址设置为 localhost ,将 Password 设置为 postgres (默认设置),点击Save password?
  3. 我保存设置,其余字段保持不变
  1. General tab: I set Name to localhost
  2. Connection tab: I set Host name/address to localhost, set Password to postgres, which is the default, click on Save password?
  3. I save the setting, leaving the rest of the fields as is

  • 就是这样,我可以立即看到在Postgres中创建的数据库.
  • 这篇关于在Windows的Ubuntu上通过Bash安装的Windows 10和Postgres上的PgAdmin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆