Can't connect via ssh tunnel

chris221's profile image chris221 posted 4 years ago in General Permalink

Trying to connect via "MySQL (SSH tunnel)" resolves in the following error: Lost connection to MySQL server at 'handshake: reading inital communication packet', system error: 0uery

I cannot figure out where the problem is. It is only one of my customers server which doesn't work.

If I try to connect via putty with the same data, the ssh connection works fine. If I then use mysql -u user123 -p the connection works fine. It's just HeidiSQL which doesnt want to connect.

Those are my settings:

  • i.imgur. com/hl3YQBM.png
  • i.imgur. com/sJzs8dd.png

(cannot post links right now)

Is there any log file with more detailed logs? Thanks!

ansgar's profile image ansgar posted 4 years ago Permalink

You can activate debug logging, in Tools > Preferences > Logging. But I doubt that this is of much help.

You may add this to your sshd_config: (taken from another thread here)

AllowTcpForwarding yes
ansgar's profile image ansgar posted 4 years ago Permalink

Ah, and you should prefer 127.0.0.1 over localhost.

Here are the screens, for conveniance:

Description

Description

ansgar's profile image ansgar posted 4 years ago Permalink

And another thing: v11.1 installs its own plink.exe - probably you should prefer that version over your own one.

chris221's profile image chris221 posted 4 years ago Permalink

I'm not the only one with that problem: https://forum.df.eu/forum/produkte/webhosting-und-server/7026-probleme-bei-managedhosting-64

I just used opened a tunnel in a terminal (via ssh -TNL 5001:/var/lib/mysql/mysql.sock SSHUser@Domain.tld) and created a new direct MySQL connection in HeidiSQL which works now.

Is there a way to execute the tunnel command automatically with HeidiSQL before connecting, so I don't have to open another terminal?

ansgar's profile image ansgar posted 4 years ago Permalink

Did you update to the latest release?

No, you can't automatically execute a system command before connecting.

chris221's profile image chris221 posted 4 years ago Permalink

Yes updated to the latest version, but not the nightly build.

NishantAggarwal's profile image NishantAggarwal posted 4 years ago Permalink

Great Information was very useful for me

ansgar's profile image ansgar posted 4 years ago Permalink

@chris221: an idea to make that more comfortable would be to create the tunnel via scheduler (on Windows: taskschd.msc). You could time it so it runs when Windows started, or when you log on.

chris221's profile image chris221 posted 4 years ago Permalink

Hm yeah but I don't need to use this db on every computer start. I rather just have a connect.cmd/connect.sh file. That way it's still easier to connect.

doc11's profile image doc11 posted 4 years ago Permalink

@chris221: if you are a domainfactory customer, then you can enter the following ip "127.0.0.3" in "Hostname /IP" and then it worked for me.

JAB Creations's profile image JAB Creations posted 1 year ago Permalink

Simplified

The Settings Tab requires the MariaDB root user credentials with port 3306.

The SSH tab requires the Linux root user credentials. The first port is 22 (or 7822 for A2 Hosting) while the second port ("Local port") requires 3306.

karsynsava's profile image karsynsava posted 1 year ago Permalink

veru inforative

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