如何使用 DataGrip 通过 SSH 连接到数据库 [英] How to connect to database through SSH using DataGrip

查看:82
本文介绍了如何使用 DataGrip 通过 SSH 连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使用命令行正确连接和设置,我简单地"必须做:

  1. ssh @-L 1139:arcade:139
  2. 输入
  3. psql -h postgres
  4. \c ift2935
  5. 将search_path设置为inscriptions_devoir;

但是,我一直想使用比命令行更复杂的工具来探索数据库并尝试不同的 SQL 命令.作为 JetBrains 的粉丝,我决定尝试使用 DataGrip.

我确实读过

我的问题很简单:我应该在什么地方输入这些东西?

解决方案

想通了!

SSH 内容已正确设置.最顶部的 Name 字段是错误的.

对于名为 MySQL 数据库,这将是输入(第一张图像用于 SSH 信息,第二张图像用于一个用于 General 信息):

(忽略最初的问题是关于 PostGreSQL 的事实.总体思路保持不变.)

To connect and set up properly with a command line, I "simply" have to do:

  1. ssh <MY_USERNAME>@<URL> -L 1139:arcade:139
  2. Enter <MY_PASSWORD>
  3. psql -h postgres
  4. \c ift2935
  5. set search_path to inscriptions_devoir;

However, I've been tempted to use a more complex tool than the command line to explore the database and try out different SQL commands. Being a fan of JetBrains, I've decided to try out DataGrip.

I have indeed read the actual help page but it doesn't provide me with the information I need.

I lack the understanding of the jargon to know the correspondance, in terms, between the different lines I had to enter and the actual field-names that I am supposed to enter in DataGrip.

My question is quite simple: what and where do I type the stuff ?

解决方案

Figured it out!

The SSH stuff was properly set up. The Name field at the very top was wrong.

For a MySQL database called <DB_NAME>, this would be the input (first image is for the SSH infos, the second one is for the General infos):

(Disregard the fact that the initial question was about PostGreSQL. The general idea stays the same.)

这篇关于如何使用 DataGrip 通过 SSH 连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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