title: SSH Access using Renci.SSH to MySQL Server
body: <p>Trying to access a MySQL server using the Renci host SSH library.</p>
  
  <p>I got it working by following the info <a href="https://stackoverflow.com/questions/18507945/creating-a-forwarded-port-within-an-ssh-tunnel">Creating a forwarded port within an SSH tunnel</a></p>
  
  <p>Specifically this line got my local port sucessfully set up such that it could be bound:</p>
  
  <pre><code>ForwardedPortLocal port = new ForwardedPortLocal("localhost", 3306, "localhost", 3306));
  </code></pre>
  
  <p>This is fine, but as I understand it the SSH client is binding to 3306 to receive data back from the server. This is a problem if the user has MySQL already installed as it will be using this port so my service cannot. Of course the service can be stopped but this is not a very friendly process.
  I was expecting to be able to pass a High - Ephemeral - Port to listen on for the duration of my connection.</p>
  
  <p>I got a bit confused on which parameter I should pass, having originally thought the second port would be the local port I need to bind to. After extensive experimentation on port configs I am at a loss as to how to handle this.</p>
  
  <p>In addition I tried various overloads but none of the 3 other overloads seemed to produce what I wanted.</p>
  
  <p>Any tips?</p>
  
  <p>Thanks,</p>
  
  <p>Andy</p>