Search code examples
sqlworkbenchssh-tunnel

Connect to Remote MySQL Server as Root over SSH Tunnel


I have opened a SSH tunnel to my MySQL server with the following command

ssh -fNg -L 3307:127.0.0.1:3306 myuser@myhost -vv

In Workbench I open a new connection to localhost:3307 and test the connection. I'm promted for the Root password, which I enter, then it tells me the parameters are correct.

When I go to save the connection I get the error...

Exception caught while processing action from home screen: error calling Python module function WbAdmin.autoDetectLocalInstance

Is this a probllem with Workbench or my Tunnel? How do I resolve it? I feel like I'm so close. The desired outcome is so that I can securely administer my remote MySQL database with Workbench.

Other info...

  • MySQL Server is Windows 7
  • SSH server is on the MySQL machine and is Cygwin
  • Workbench client is on OSX
  • I also tried to use Workbench to make the tunnel (New Connection -> SSH etc.). I ran into problems there with it telling me my server OS wasn't windows, which was a lie:)

Solution

  • OK turns out that the connection was saved. In spite of the error, closing and reopening Workbench showed the saved connection and allowed me to connect. It must be a bug in Workbench or something.

    Furthermore I can also tunnel using the SSH connection in Workbench since the restart.