Strange 1-Time Connect and then I have to restart my computer

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago in Creating a connection Permalink

I'm having a strange issue with HeidiSQL. I setup two SSH Tunnels for two different servers and it works fine. Once I am done with it and close down Heidi and open it up again to connect it will fail. Even though none of the settings were changed with the error: Access denied for user 'root'@'localhost' (using password: YES)

I can use the exact same settings in CLI on the server and connect fine or I can go into SQL Workbench and use a SSH Tunnel with the same settings and work fine. If I restart my whole computer and use Heidi again, it will work and connect fine for that one time until I close Heidi down or lose connection and then it will not be able to connect again until I restart my computer.

Does anyone know the cause for this?

ansgar's profile image ansgar posted 8 years ago Permalink

Sounds like a plink.exe process is not stopped at the end of the first session, and then the second fails as it cannot open plink with the same local port or something. You can check that easily using the task manager, and watch out for plink.exe processes which start when you open a HeidiSQL session. If it does not go away when you close the session, then that may be the issue.

You should also report the used HeidiSQL revision, or even better, always be sure to be on the latest revision before reporting any issues here.

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

Sounds like a plink.exe process is not stopped at the end of the first session, and then the second fails as it cannot open plink with the same local port or something. You can check that easily using the task manager, and watch out for plink.exe processes which start when you open a HeidiSQL session. If it does not go away when you close the session, then that may be the issue.

You should also report the used HeidiSQL revision, or even better, always be sure to be on the latest revision before reporting any issues here.

Oddly I can't find plink still running in Task Manager, and more strangely is that I do believe it establishes SSH connection since it gives a warning about how it can't access the SQL server. I might be wrong but it does look like it connects via SSH and then fails on the SQL side, even though it works after a restart or works simultaneously with workbench or CLI

ansgar's profile image ansgar posted 8 years ago Permalink

Ok, then could you please try a higher setting for the plink.exe timeout. Probably you are using the default 4 seconds, and your ssh connection is not ready such quick.

You could also copy the plink.exe command from HeidiSQL's log panel to a shell box, add the deleted password and run the command manually. This should tell you how quick your ssh connection normally is.

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

Ok, then could you please try a higher setting for the plink.exe timeout. Probably you are using the default 4 seconds, and your ssh connection is not ready such quick.

You could also copy the plink.exe command from HeidiSQL's log panel to a shell box, add the deleted password and run the command manually. This should tell you how quick your ssh connection normally is.

Can you tell me how to access Heidi's logs?

ansgar's profile image ansgar posted 8 years ago Permalink

The logs are at the very bottom, where you see the commands rush in when you click on a table, database or whatever.

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

The logs are at the very bottom, where you see the commands rush in when you click on a table, database or whatever.

I've attempted this and it appears to work in CMD, this is all it shows: i.imgur.com/0rUTBzw.png

So I can only assume that it is working properly. However it is still giving errors in Heidi, now even sometimes after a restart. I have confirmed the details of the SQl are correct though.

I appreciate you helping me with this issue, I really don't want to have to go back to using Workbench haha.

ansgar's profile image ansgar posted 8 years ago Permalink
  1. How long did the ssh connection take to establish in CMD?
  2. Please run that again in a CMD window, then create a new HeidiSQL session using network type TCP/IP now, try to connect to the running plink.exe shell with that, and watch out if the errors are still happening.
[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink
  1. It takes about 2 seconds for the connection to establish in CMD
  2. Doing as you described connecting to port 3007(the local port I bind with plink.exe) it works perfectly fine and I can use the TCP/IP connection while having the plink.exe running separately.
ansgar's profile image ansgar posted 8 years ago Permalink

Probably increase the plink.exe timeout in the session manager?

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

Probably increase the plink.exe timeout in the session manager?

I already did increase it to 10 seconds. It will just wait 10 seconds and then say it couldn't connect. However using the same settings and running plink directly from CMD will connect fine and bind the port. So there really is no reason this shouldn't be working. This has to be a bug of some sort no?

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

My quote got messed up, please make sure you read in the quote

ansgar's profile image ansgar posted 8 years ago Permalink

I have no clue why that happens, really.

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

I have no clue why that happens, really.

Is there anything I can provide for you to help you with investigating it?

ansgar's profile image ansgar posted 8 years ago Permalink

I'm wondering whether the plink.exe process is working as it should, or is it the SQL connection which is not working? The things you tested above are mainly to verify the plink process, and you said it worked properly when you started it via command line. So I highly guess HeidiSQL is not able to start plink for the second time, for some reason.

Important: Please verify you are using the latest build of HeidiSQL, not just the latest release. Probably I already fixed something here, and I just can't recall what it was.

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

I'm wondering whether the plink.exe process is working as it should, or is it the SQL connection which is not working? The things you tested above are mainly to verify the plink process, and you said it worked properly when you started it via command line. So I highly guess HeidiSQL is not able to start plink for the second time, for some reason.

Important: Please verify you are using the latest build of HeidiSQL, not just the latest release. Probably I already fixed something here, and I just can't recall what it was.

I am running the latest Nightly

[expired user #10109]'s profile image [expired user #10109] posted 8 years ago Permalink

This is still an issue for me and I have to open a cmd window to bind the port each time because the tunnel won't work properly.

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