I'm attempting to connect to mySQL through two SSH hosts and haven't been able to find a solution anywhere online.

If I were connecting with Putty, I would connect to the first box (let's call it MainBox), and then "ssh subBox". Then at that point I'd be able to log into mySQL. However, on workbench I can't jump through multiple hosts like this, and I have no other way to access the database.

How can I do this?


The main issue here is that you need to set a shh tunnel in the first step and then use it as a bridge to get the workbench communication to mySQL database in the 3306 (or whatever configured port).

What putty really does is to set a ssh connection, which let hosts to exchange keys and establish the ssh protocol communication in port 22. The workbench wont do that but you can set the environment independently.

Please refer to these 2 references and provide feeback. Access Your Database Remotely Through An SSH Tunnel Standard TCP/IP over SSH Connection Method

| improve this answer | |

add this to your ssh config:

Match host=*.swim.swf
        proxycommand ssh -q -W %h:%p swim-bastion

| improve this answer | |
  • 2
    Some additional explanation about what this syntax does would be handy. – Paul Gear Mar 5 '19 at 22:29
  • If you have an up to date ssh version it's better to use ProxyJump. – kasperd Mar 6 '19 at 7:57
  • ProxyJump did not work for me in combination with mysql workbench so I had to fall back on proxycommand @kasperd – Pieter Willaert Mar 6 '19 at 8:19

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.