Friday, June 14, 2013

How to Use MySQL Workbench behind proxy/firewall

In this tutorial, the ssh session and workbench are configured to connect to MySQL instance provided by AmazonWS.
 
1. Make sure you have tunneling server you can ssh via port 443 or 80 (In most cases, only these two outbound ports are allowed go through corporate firewall/proxy).
2. Configure the putty ssh session for tunneling in order use MySQL Workbench to connect to the remote MySQL DB server
2.1. Shh session







Note:
 2.3. Connection > Proxy

 Note: port 3128 is used for this tutorial; for your case, you need to check your corporate proxy server port for the correct one.

2.3. SSH > Tunnels
 
 Note:

3. Configure MySQL Workbench to connect the DB server via the putty ssh session

Note: in this tutorial, the workbench is configured to connect to MySQL instance provided by AmazonWS.
Extra: this tunnel can be used to connect the DB in java code as follows:


Note:

8 comments:

  1. Great article! Thank you! Very usefull.

    ReplyDelete
    Replies
    1. Many thanks for your comment!…Glad to hear you found it helpful!

      Delete
  2. Not working for me. I tried the same. Could you provide more details on this setup

    ReplyDelete
  3. Hi gokul, could you please share which part is giving your error?

    ReplyDelete
  4. Works for me. with 1 Additional step, which I think you should include here ....the *.PPK file of amazon see printscreen (https://www.dropbox.com/sh/clxulu7zkp1rob1/AAB82IAMWormiLGpRZYRJGSXa?dl=1), without this you WILL NOT be able to connect.

    what is ppk : http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html

    ReplyDelete
  5. You mean Putty by "MySQL Workbench"!!!!!!!

    ReplyDelete
    Replies
    1. remote Mysql connection from putty through SSH tunnel

      Delete
  6. just check local ports accept connections from other host in tunnels scree and you are all done.
    thanks for this blog

    ReplyDelete