I'm using HeidiSQL Portable 184.108.40.20694 with SSH to access MySQL databases. My connections are intermittent with the same credentials; sometimes it connects quickly and other times it fails with connection errors (10061). I've tried increasing the default timeout to 25 seconds, but it still fails.
I verified I can access MySQL on my Ubuntu Server with Putty. I know HeidiSQL uses the Putty PLINK. Could there be a problem with the private key file? I've cached it through Putty, but does HeidiSQL have to resolve it everytime?
Any direction to help stabilize my MySQL Connections to make them dependable would be greatly appreciated.
And yes, plink has to use the private key to authenticate every time it connects to your server via ssh; this cannot be changed.
[Update] using heidisql's user manager, check wether the 'user account' list on the left side contains an entry with Username = root, Host = localhost. It is NOT sufficient to have an entry root / 127.0.0.1; 127.0.0.1 is usually identical to localhost for routing, but not for mysql's authentication.
Under settings, I will try changing Hostname/IP to localhost instead of 127.0.0.1 for MySQL authentication.
the private key file (.ppk) has to be specified in the heidisql session parameters (ssh tunnel tab), or via the -i switch to plink if you use it manually.
however, since you seem to be able to connect to the server sometimes, i do not think your problems ist is related to the .ppk - access would consistently never work if there were a problem with the private key.
are you sure that you have the correct (mysql) password in the Password field of the 'settings' tab ? (below 'User' = 'root')
NB you probably know that the above mentioned username/password that you can use with Putty go into the Username/Password fields of the 'SSH tunnel' tab (below the name of your host in 'SSH host').
I deleted my HeidiSQL Session Name and recreated the one I couldn't access. It now works, BUT I now can't access my other saved session name. I know I had the credentials entered correctly for both saved session names.
Does HeidiSQL only allow one open session at a time? Does it use the credentials of the previous open session when launching a new session?
Does it use the credentials of the previous open session when launching a new session?
How do you try to access the second session ? From the 'File' menus 'connect to >' submenu ? what happens when you try to connect a second session ?
what exactly means "i can't access" ? what exactly happens when you try to open a saved sesion with only the local port changed from before ? what error message (if any) is shown ?
please do also try
plink.exe -v -pw password -L3307:127.0.0.1:3306 user@host
and look at the messages. Anything strange there ? does it open to a shell on your host or not ?
Second, thank you for your quick responses and suggestions helping me. This reinforces my loyalty to use HeidiSQL.
Third, as we try different things, I'm looking for patterns on behavior.
I ran "plink.exe -v -pw password -L3307:127.0.0.1:3306 user@host" for all my HeidiSQL Sessions from the command prompt and was able to log into each with no problems.
AFTER using command prompt, I was able to log into my first SSH HeidiSQL Session. Leaving the first session open, I tried my other two saved sessions with all three having the SAME SSH tunnel local port of 3307. These two sessions failed with MySQL Error 1045 "Access denied for user user@localhost using password YES".
BUT then I changed the ports of the last two saved sessions to 3308 and 3309 with the default 4 second timeout and HeidiSQL was able to access ALL saved sessions at the same time. I can switch between connections by clicking the session name.
So the pattern I see is I can use HeidiSQL AFTER running PLINK from the command prompt. When I did this some sessions, but not all asked me to cache the key. This is the only pattern I see.
I would appreciate your thoughts and input.
a) it is principally not possibly to use a tcp port for more than one connection; that's why you have to use different local port numbers in sessions that you plan to use at the same time. (there was a feature suggestion some time ago to automatically set the local port field to some free port's number upon session creation, which would handle this problem automatically; but it has not been implemented yet.)
b) "HeidiSQL AFTER running PLINK" - yes, i should have thought of that earlier... plink, when contacting a server for the first time, always queries the user wether to cache the server's key in registry, as you have seen.
if you do not answer this question, plink will silently fail after a time; that's most probably what happens when it is called internally from heidisql.
once you have answered this question with "yes", it will not again be asked, and further plink calls will succeed from within heidisql.
although heidisql's handling of text responses from plink has been improved considerably, it still does not always work; thus, you generally should call plink manually once for each new server to answer the "caching" question, and store its answer in the windows registry. after that, connecting to that server from heidisql via ssh should generally work.
Is it a good practice to simply run PLINK first from the command prompt before starting a saved session from HeidiSQL even if its not a new server?
- AFAIK the caching does not expire. It lives at HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys, key being the server's name, and the question will only be asked again if a server's public key should change (which is really rare in practice).
- so I dont think plink-before-heidisql is necessary; in most of the cases it should only be done once for a new server.
But: I do not have an explanation why you were asked again for your server (unless you did it as different windows users, which i do not assume). I suggest you observe the behaviour for a while, possily yours is a special case for reasons unknown.
you could also write to ansgar (the developer) and plead for upgrading heidisql's handling of text responses from plink, so that the "cache this key" question, if it occurs, is related to the heidisql user not as a simple message dialog, but as a yes/no or text input dialog.
I agree it looks like the only "issue" with HeidiSQL is the ability to allow the user to respond to PLINK's Cache question. How do I contact the developer to suggest an enhancement?
mentioning his name (ansgar) might help.
also, except for the long run of experiments necessary to come to this conclusion, the real problem found - the somewhat strange necessity to run plink once manually for each new server accessed via ssh - has flummoxed quite a number of people before; i think it really should be addressed (in plink response handling) to prevent repeated support requests for ssh problems in the first case.
Please login to leave a reply, or register at first.