Cannot connect two different servers using SSH tunnel simultaneously

[expired user #8648]'s profile image [expired user #8648] posted 9 years ago in Creating a connection Permalink
Hi there!!

I'm having trouble to connect to two different servers using "MySQL SSH tunnel". Here I have the steps to reproduce the problem:

1. Open a connection to one server, via MySQL SSH tunnel.
2. Open a new instance of HeidiSQL, without quitting the first one.
3. Select another server on the list, also using a MySQL SSH tunnel connection type, and open it.

Now, the sencond instance shows the databases from the first (although the title shows that I am connected to the second server). No matters how many instances I open, it always shows the database from the first server if I choose "MySQL SSH tunnel" on all of them.

If I open the connectios to those server separately (i.e., I close the first window after launching the second), then there's no problem, so I think there's a bug on HeidiSQL or Plink (don't know exactly). Also, if the second connection I open is from other type (I've tested with "MySQL TCP/IP") then no problem - I can connect to both servers fine. But since I'm trying to connect to a remote server, I can only use SSH tunnel.

I'm using HeidiSQL 9.1.0.4896 (last version) on Linux (CentOS 6.6) using Wine. If needed, later I can try to reproduce the problem at home using Windows. If you need more information, please tell me.

Thanks for your great work!
ansgar's profile image ansgar posted 9 years ago Permalink
See this thread
[expired user #8648]'s profile image [expired user #8648] posted 9 years ago Permalink
I've just done that and works perfectly!!

Thank you so much for your fast answer and for this great software smile
[expired user #8648]'s profile image [expired user #8648] posted 9 years ago Permalink
By the way, don't you think that this parameter (SSH local port) should be selected randomly, without user intervention?

For example, if I want to open two connections to the same server, it will be too slow because they share the same connection. If I use a different local port on the second connection to the same server, it'll perform OK, so I think local port shouldn't be defined by the user.
ansgar's profile image ansgar posted 9 years ago Permalink
Yes, such an approach would fix that confusion mostly. But I think I need to watch out if that random port is already in use by some program before selecting it. And I would still leave it as an option so the user can still change it if he wants to.
ansgar's profile image ansgar posted 9 years ago Permalink
r4949 now checks if the local port for plink is already in use before plink is executed. If it's in use, a connection error pops up, forcing you to change the local port.
Electrosa's profile image Electrosa posted 9 years ago Permalink
OK, it works perfectly. Thank you so much!!

Please login to leave a reply, or register at first.