1

I'm new to these things, I'm familiar with the command lines and the SQL commands. I am currently working on a MySQL database that I have installed on a Linux server (Ubuntu Server) remotely outside my city.

In the office I use a macOS machine to develop applications and manage the server. Currently I move data to and from my computer and server using the scp command, with which I load any SQL scripts to update the remote database and so on.

We are recently using DataGrip, I would like to configure it, but I can not.

Can someone kindly explain to me a simple configuration procedure?

Currently I know:

  • the listening port used by MySQL, which is 3306

  • the IP address of the remote server

  • the login username and password

I enter this information, but DataGrip can't connect. How can I check what's wrong? How can I understand what I'm doing wrong?

Sorry for my ignorance.

I tried to connect in two ways, as shown in the following two figures.

enter image description here enter image description here enter image description here

I tried also through terminal:

enter image description here

5
  • 1
    In the datagrip ssh-tunnel, it looks as if you didn't enter a "proxy user". Apr 24, 2018 at 8:30
  • Tried adding the user, but not working. I am trying this now.
    – kitsune
    Apr 24, 2018 at 8:37
  • How do you manage scp if you can't use ssh to connect? Apr 24, 2018 at 8:48
  • Honestly I do not even know myself, I probably inserted something badly in DataGrip.
    – kitsune
    Apr 24, 2018 at 9:01
  • Enter the host, user and password you're using for scp, in the ssh tunnel parameters of datagrip, and "test connection". Apr 24, 2018 at 9:07

1 Answer 1

1

Is MySQL listening on the public IP of your remote server? Is the 3306 port on the public IP of the remote server reachable from outside?

Most likely no, and that's good.

What you need to do is tell DataGrip to open a ssh port forward to the server (a tunnel) and then open a connection to MySQL.

It looks like DataGrip fails to access the server via ssh.

Try to ssh into your server from OSX like this:

 ssh -L 3306:localhost:3306 your-ssh-user@your-remote-host

If you don't get any error, enter the following info under SSH/SSL tab:

Proxy Host: your-remote-host
Proxy User: your-ssh-user
Proxy Password: your-password

Then click 'Test connection' and verify that you don't get any error.

Note that your credentials to access the server via ssh are different from your MySQL credentials!

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .