Cant connect to server 127.0.0.1 (10061) since new HeidiSQL version

Fannin's profile image Fannin posted 7 months ago in General Permalink

Hi!

Since the new Heidi version and using the new plink, I get this error when I ssl to my AWS database. The SSL part seems to work since I get the "do you want to add this server to plinks cache" modal but then it fails with "Cant connect to server 127.0.0.1 (10061)". It's an up-to-date MariaDB database.

I've tripple-checked the DB credentials, they are correct. The same credentials work using PyCharms database explorer.

Any ideas what I've might be doing wrong? I love HeidiSQL and would really like to keep using it.

Best from Cologne Ronny

ansgar's profile image ansgar posted 7 months ago Permalink

You're sure you are using plink v0.83 from the HeidiSQL installer?

I suppose the SSH tunnel was not established probably. Please don't mix SSH with SSL.

You could try ssh.exe instead of plink. Or try to connect with plink manually:

plink.exe -ssh -legacy-stdio-prompts sshUser@hostNameOrIp -P 22 -i "C:\Users\YourUser\.ssh\id_rsa" -N -L 3308:127.0.0.1:3306

Note that line may be wrong, please read carefully.

Fannin's profile image Fannin posted 7 months ago Permalink

Thx for the tip! When I run the command manually, it works! No idea why but now I can connect.

Super weird, didn't change anything. But thx for the tip ❤️

painfulpanda's profile image painfulpanda posted 7 months ago Permalink

Made an account to respond to this thread. I can confirm the latest version has broke something with ssh forwarding. Before this latest version, I was able to port forward just fine, now it's not working anymore.

If I copy and paste the plink command into my terminal, then login it works fine. Seems something is going on with HeidiSql side.

/* Attempt to create SSH process, waiting 4s for response ... */
/* plink.exe -ssh -legacy-stdio-prompts root@xxxxx -P 22 -i "C:\Users\xxxx\.ssh\id_rsa_putty.ppk" -N -L 3308:127.0.0.1:3306 */
/* Can't connect to server on '127.0.0.1' (10061) */
/* Closing SSH process #18892 ... */
/* Access is denied */

From my terminal doing it manually

PS C:\Program Files\HeidiSQL> ./plink.exe -ssh -legacy-stdio-prompts root@xxxxxx -P 22 -i "C:\Users\xxxxx\.ssh\id_rsa_putty.ppk" -N -L 3308:127.0.0.1:3306
Using username "root".
Access granted. Press Return to begin session.
ansgar's profile image ansgar posted 7 months ago Permalink

@painfulpanda the plink command itself seems successful, as there is no message saying "SSH process exited after x ms with code y" in your log. Also no message like "SSH: Access denied", which plink normally spits out when a password is wrong or the key cannot be used.

So I suppose the last line saying "Access is denied" is from the database server, but then again MySQL's phrasing would be different. What's the database type here?

You should try to create the tunnel on your terminal, then log in per HeidiSQL without tunnel configuration (to 127.0.0.1)

painfulpanda's profile image painfulpanda posted 7 months ago Permalink

It's a MariaDB. If I create the tunnel using the plink command I showed you above, then changed heidisql to connect to the tunnel port directly, it works. It's only when Heidisql does the tunneling itself it does not work.

ansgar's profile image ansgar posted 7 months ago Permalink

Strange. Probably the port is not the correct one when the tunnel is created by HeidiSQL?

painfulpanda's profile image painfulpanda posted 7 months ago Permalink

Okay, I think I figured out what is happening. The store key prompt doesn't appear to be storing the key correctly (or answering plink correctly?). If I continue to answer yes, then reconnect, it (Heidi) asks me again.

If I go to my terminal and run the plink command, save the key, then try again from HeidiSQL, it works. Could this be it?

Fannin's profile image Fannin posted 7 months ago Permalink

The store key prompt doesn't appear to be storing the key correctly (or answering plink correctly?). If I continue to answer yes, then reconnect, it (Heidi) asks me again.

This sounds very plausible. This is exactly why it works for me now. Using the CLI made the storing work and now I can continue using Heidi. 👌

welja's profile image welja posted 7 months ago Permalink

I have the same problem and installed HeidiSQL_12.10.0.7000_Setup which fixed the issue. The host is a mariadb server and i am using ssh (plink) to connect to it.

I went through the Nightly Builds of heidisql.exe and found that the issue started with revision 12.10.0.7056 Issue #2118: activate legacy-stdio-prompts mode in plink SSH tunnel, to fix non prompted passphrase since plink 0.82 If i use 12.10.0.7055 it still works.

I use plink version 0.81 and heidy did not gave me a headsup that i should upgrade plink.

ansgar's profile image ansgar posted 7 months ago Permalink

@welja Please use the plink version shipped with HeidiSQL.

welja's profile image welja posted 7 months ago Permalink

@ansgar That works! I did not know that heidisql shipped with plink these days. Years ago i seem to remember that i needed to download it myself.

Anyway thanks!

ansgar's profile image ansgar posted 7 months ago Permalink

Thanks for your feedback.

Yes, in earlier versions there were no such breaking changes to the plink parameters, first time now. In June 2020 I decided to ship plink with the installer, to ensure latest versions, and to make the SSH configuration easier for the user. Users with their custom outdated version of plink never had a problem, up to now.

painfulpanda's profile image painfulpanda posted 7 months ago Permalink

Just to verify, I am using the version of plink that ships with HeidiSQL, there is no other plink installed on my system.

ansgar's profile image ansgar posted 7 months ago Permalink

@painfulpanda in your case the issue was the non-stored key, or? Your last comment says it works for you now?

painfulpanda's profile image painfulpanda posted 7 months ago Permalink

Yes, HeidiSQL as of the latest version, for a new server, will continually display the host key store message. If I click yes, it doesn't appear to actually do anything anymore, as if I try to connect again, I get the same message.

If I copy and paste the plink command into my terminal, save the host key from there, then try to connect from HeidiSQL, it works. @Fannin confirmed this behavior as well.

twofiddy's profile image twofiddy posted 6 months ago Permalink

+1 same issue, since new version it keeps asking for my host key storage and cant connect with said error.

simshaun's profile image simshaun posted 6 months ago Permalink

+1 to follow. Previously working connection stopped working. Also asked if I want to trust the host key each time.

sad123's profile image sad123 posted 6 months ago Permalink

guys, dont overcomplicate things. just export with puttygen the current privatekey to a new algo like ed25519

twofiddy's profile image twofiddy posted 6 months ago Permalink

guys, dont overcomplicate things. just export with puttygen the current privatekey to a new algo like ed25519

But what if i have a normal up-to-date perfectly fine ed25519 key that has this exact issue? :D

vn1tyxaffair's profile image vn1tyxaffair posted 6 months ago Permalink

Hi, I am completely lost I downloaded the current version and still cannot connect to the IP address above

painfulpanda's profile image painfulpanda posted 6 months ago Permalink

Confirmed this is a bug with host key verification. Tested with ssh.exe as well and it's the same issue. If there is a host key verification needed, heidisql no longer navigates this correctly.

You have to copy and paste the ssh.exe command listed in the log window to your terminal, accept the host key, then attempt in heidi, it'll work fine after.

r3act10n's profile image r3act10n posted 5 months ago Permalink

Any updates on this? We are experiencing similar issues. We already use ed25519 keys, but we are still unable to connect.

Fannin's profile image Fannin posted 5 months ago Permalink

@ansgar What's your take on this issue? (https://www.heidisql.com/forum.php?t=44193#p44212)

When I run it, the storing works and I can access the DB via Heidi, when I try Heidi first, the store dialog doesn't seem to have any effect and I can't connect to the db afterwards.

ansgar's profile image ansgar posted 5 months ago Permalink

Is it that thing we're talking about?

grafik.png

Nobody seemed to notice the buttons - there is no "yes" nor a "no" button, just one "ok" button. Probably the message text changed and HeidiSQL does not see the y/n options. Will check.

ansgar's profile image ansgar posted 5 months ago Permalink

No it's not the text plink message text which was changed.

Also, the above "OK" button was a one-timer - further tests gave me the yes/no/cancel buttons again on a confirmation dialog.

Removing the -legacy-stdio-prompts argument plus using the older plink v0.81 still works normally with my current HeidiSQL build. There must have been changed more in plink 0.82. Pressing the "Yes" button sends a "y" + cr/lf to the input pipe of the plink process. It seems the input pipe is not where plink 0.82+ expects that "y".

ansgar's profile image ansgar posted 5 months ago Permalink

For further updates to this problem, please refer to the issue #2243.

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