Search code examples
sqlpostgresqlsshjetbrains-idedatagrip

How to connect to database through SSH using DataGrip


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.

DataGrip connection

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


Solution

  • 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):

    SSH inputs

    General inputs

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