1

I know there are quite a few tutorials about this, but I can not get it to work on my machine.

So I have a MySQL database running on:

Server: dbhost.net
Name: mydbuser
PW: mydbuserpwd
Port: 3306

This database is reachable via an SSH connection as this:

Server: dbhost.net
Name: mysshuser
PW: using my ssh public key

In Sequel Pro it does look like this: https://d.pr/i/Af7zUC

Now I have a local app installed that is asking me for my MySQL credentials - when I enter my normal MySQL credentials from above this will not work. So I need to enter something (Server, Username, Password) in the app that is then establishing a connection to the database via the SSH connection as mentioned above. How do I do that? I tried it with:

ssh -L 1025:127.0.0.1:3306 -p 22 -l mysshuser -N dbhost.net

And then using 127.0.0.1:1025 in the app, but this doesn't do anything. Can you assist?

  • Try replacing 1025:127.0.0.1:3306 with *:1025:127.0.0.1:3306 - This will make it listen on all interfaces. Maybe your local application tried a different interface or something. I've had that issue with a VNC application before. – confetti Sep 19 '18 at 10:07
  • @confetti Unfortunately this doesn't change anything. What else can this be? Once I type this line into my terminal, I do not see any response. Thats' correct, isn't it? – Torben Sep 26 '18 at 8:13
  • That's correct, -N does this, as you won't be actually sending anything over SSH, you just want to setup a port forwarding. You can omit the -N for testing, to see if anything goes wrong with keeping the ssh connection up. – confetti Sep 26 '18 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.