distal-attribute
distal-attribute
distal-attribute
distal-attribute

Error when trying to connect over SSH tunnel

User, date Message
Written by patheticcockroach
2 years ago
Category: General
4 posts since Wed, 13 Jun 12
Hi,

I'm having the same kind of problem (I think) as was described there: SQL Error (2003): Can't connect to MySQL server on 'localhost' (10061).

Here's my setup:
- running HeidiSQL 7.0.0.4157 at home (H)
- running a MySQL server on server A
- I want to connect with an SSH tunnel on server B, like:
H --SSH--> B ----> A

A is configured to accept connection from B's IP.
B is configured to accept tunnels (actually, I'm running a bidirectional SSH tunnel on it 24/7 for other stuff)

But when I try to connect to the MySQL server, I get the above-mentioned error message. Full log:

/* Connecting to 188.*.*.* via MySQL (SSH tunnel), username ******, using password: Yes ... */
/* Attempt to create plink.exe process, waiting 4s for response ... */
/* SQL Error (2003): Can't connect to MySQL server on 'localhost' (10061) */
/* Closing plink.exe process #2244 ... */



Any idea about what I could be doing wrong ?

Thanks
Written by jfalchMoney, Euro
2 years ago
385 posts since Sat, 17 Oct 09
tunneling is not by itself transitive. ie plink creates a tunnel from H:3306 to B:3306, and AFAIK the tunnel ends there. What program or configuration will create another tunnel from B:3306 to A:3306 ?
if you want this to be automatic, you could try to insert A´s ip address, NOT localhost, in hostname/ip field of 'settings' tab of heidisql´s session manager for this connection, while 'ssh host+port' in 'ssh tunnel' tab contains the name/address of B.
Written by patheticcockroach
2 years ago
4 posts since Wed, 13 Jun 12
"What program or configuration will create another tunnel from B:3306 to A:3306?"
=> no tunnel there (this connection I trust, unlike H-->B), I simply ask Heidi to connect to A after going to B via the tunnel.

"if you want this to be automatic, you could try to insert A´s ip address, NOT localhost, in hostname/ip field of 'settings' tab of heidisql´s session manager for this connection, while 'ssh host+port' in 'ssh tunnel' tab contains the name/address of B"
That's what I did (which is why I find the mention of "localhost" in the error message quite puzzling):
- Setings->Hostname/IP = IP of server A
- SSH tunnel->SSH host + port = IP of server B:22
Looks indeed like Heidi doesn't follow what's put the the first field, but instead goes to B then tries to connect locally... Bug or design? (but then I suppose the "Setings->Hostname/IP" field should be disabled if it's meant to be ignored)
Written by patheticcockroach
2 years ago
4 posts since Wed, 13 Jun 12
"this connection I trust, unlike H-->B"
=> or more precisely, H-->X (no edit button?)
Written by patheticcockroach
2 years ago
4 posts since Wed, 13 Jun 12
I just tried doing H --ssh--> A ----> A, and this works. So Heidi does ignore "Setings->Hostname/IP" in the case of an SSH tunnel.unhappy
 

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