HeidiSQL mixing up SSH tunnels

[expired user #8920]'s profile image [expired user #8920] posted 9 years ago in General Permalink
Using 9.2.0.4948

I have come across a strange issue. I have two identical databases one on a remote server and the other on a local server. The databases are an exact copy of each other. Also all usernames, passwords are database names are identical.

I created 2 sessions in HeidiSQL one for each server. I connected to the remote database did some changes and disconnected, then connected to the local session and dropped the database ...to my astonishment the database that was dropped was the one on the remote server. Even more strange is that if I completely delete the session pointing to the remote server and use only the session pointing to the local server still it connects to the remote server.

Luckily no critical data was lost but it is a serious issue.

I am assuming HeidiSQL is keeping some temporary session files and they are being used because the database name is the same. Can I somehow flush these temporary files ?
ansgar's profile image ansgar posted 9 years ago Permalink
There are no temporary session files somewhere. But there is probably an unused plink.exe process which HeidiSQL was not able to terminate at the end of the session. And I'm pretty sure your both sessions used the same "Local port" in the "SSH tunnel" tab, right?
[expired user #8920]'s profile image [expired user #8920] posted 9 years ago Permalink
oops ...yep same plink port, that explains it!
Thanks
Code modification/commit from ansgarbecker, 9 years ago, revision 9.2.0.4949
Raise connection error when local SSH port for plink is already in use. See http://www.heidisql.com/forum.php?t=18395
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. Please update, so you're safer when dropping a database next time :)
[expired user #8920]'s profile image [expired user #8920] posted 9 years ago Permalink
that was quick! thanks :)
ansgar's profile image ansgar posted 9 years ago Permalink
r4964 now tries the 20 next higher ports if the specified one is already in use. So the likeliness of getting that "Port in use" error is very low now, while HeidiSQL still uses one plink process per tunnel connection.

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