Trying to access a MySQL server using the Renci host SSH library.
I got it working by following the info Creating a forwarded port within an SSH tunnel
Specifically this line got my local port sucessfully set up such that it could be bound:
ForwardedPortLocal port = new ForwardedPortLocal("localhost", 3306, "localhost", 3306));
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.
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.
In addition I tried various overloads but none of the 3 other overloads seemed to produce what I wanted.
Any tips?
Thanks,
Andy