Workbench migration via ssh - how to set up a tunnel

2.6k views Asked by At

I try to migrate MSSQL (local machine) to MYSQL (Amazon Web Services) usin Workbench. I can connect to both databases. However when I migrate I get this error:

Mysql connections through SSH are not supported in this version...

Well, I found this in documentation:

A workaround is to set up an encrypted tunnel, and then treat the MySQL target as a standard TCP (unencrypted) connection.

But I don't know how to set up a tunnel. Does anyone can help?

2

There are 2 answers

6
Patrick Tucci On BEST ANSWER

Okay, if I'm understanding this correctly, I think I'd prefer to set up a tunnel in Putty. I don't have a solid grasp of how MySQL Workbench works (I'm assuming its analogous to SSMS), but I have used maaany SSH tunnels in my day. Here are some basic instructions:

http://www.electrictoolbox.com/putty-create-ssh-port-tunnel/

You'll want to create a local tunnel from any port you choose (although I'd go with the MySQL default 3306) to the destination of 127.0.0.1:3306. Be sure to click add and save your session settings in Putty.

Open the SSH connection to the AWS machine. Try to connect to your MySQL instance through 127.0.0.1:3306. This should allow you to pull from your local SQL Server and send data to your AWS instance (through the tunnel, 127.0.0.1:3306 of course).

Hope this helps. Let me know if this doesn't solve your issue.

0
Mike Gorski On

If you have Amazon ec2: On Windows machine connect using putty via ssh:

  1. In session host name (user@public_ip_address)
  2. Connection -> SSH -> Tunnels (Source port: 3306 OR choose free one) AND (Destination 127.0.0.1:3306)
  3. You can check if tunnel was establihed in event log (right click on terminal bar)
  4. In Workbench now you can use TCP/IP without SSH.

Thanks guys!