Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

SSH-Tunnel-Connection trying to connect to "localhost"

mmarsching's profile image mmarsching posted 11 years ago in Creating a connection Permalink
It seems I have a lot of trouble connecting to my development server... I try to use a SSH-Tunnel-Conn with the following parameters

[Settings]
Network typ: SSH tunnel
IP: 192.168.178.37 (server!)
User: (mysql-user root for testing purposes)
Password: (mysql-root-pw)
Port: 3306

[SSH tunnel]
plink.exe location: c:\plink.exe
SSH host+port: 192.168.178.37 / 22
Username: root (SSH-user)
Password: root-pw (SSH)
Private key file: (empty)
Local Port: 3307

and always get the following error message:
"SQL Error (2003): Can't connect to MySQL server on 'localhost' (10061)"

Why localhost? What have I done wrong, am I too dumb to use SHH-tunneling without using pure Putty? :D

Thanks for all your help in advance!

Michele
ansgar's profile image ansgar posted 11 years ago Permalink
SSH host+port: 192.168.178.37 / 22
I guess this IP was not entered manually and it's greyed out? Try to do so, otherwise HeidiSQL uses "localhost" for the MySQL connection.
mmarsching's profile image mmarsching posted 11 years ago Permalink
No I had seen that... so I copied the 192.168.178.37 from "Settings" to "SSH tunnel"-tab
mmarsching's profile image mmarsching posted 11 years ago Permalink
I have tried

[Settings]
Network typ: SSH tunnel
IP: 192.168.178.37
User: root
Password: (mysql-root-pw)
Port: 3306

[SSH tunnel]
plink.exe location: c:\plink.exe
SSH host+port: 192.168.178.37 / 22
Username: root (SSH-user)
Password: root-pw (SSH)
Private key file: (empty)
Local Port: 3306

now and get a "connection", but all I see is my local mysql db. If I turn that one off, I still get "SQL Error (2003): Can't connect to MySQL server on 'localhost' (10061)".

Any other ideas? unhappy
mmarsching's profile image mmarsching posted 11 years ago Permalink
OK, for all of you folks out there - I found the error!!happy

The first time plink connects to a server it has to accept the servers host key, whether you connected with putty before or not! So open the command shell, change to the directory where your plink.exe is located and just run the following line once (examples from my case):
plink.exe -P 22 -l root -pw (root-pw) 192.168.178.37

After thet you have to accept the servers key by pressing "y". You can close the command line now - en voilá, the next time you try to connect with HeidiSQL the connection works!

Good luck everyone - and anse please fix this "bug" :)
ansgar's profile image ansgar posted 11 years ago Permalink
plink is executed with a hidden window, intentionally. Very tricky to make plink and heidi interacting with each other. Basically the same discussion as in issue #1914.
bitkidoku's profile image bitkidoku posted 11 years ago Permalink
@mmarsching: Thank you very much, if you had not post the solution I would have spent hours wink

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




Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.