Bug? Try to log into AWS host, keeps opening my localhost DB

[expired user #7361]'s profile image [expired user #7361] posted 11 years ago in General Permalink
I recently installed MySQL locally. Now whenever I try and connect to my AWS host MySQL DB using SSH tunnel, HeidiSQL simply connects to the MySQL DB on my local machine.

Nothing seems to stop it from doing that.

So weird. Any ideas?
ansgar's profile image ansgar posted 11 years ago Permalink
I rewrote the whole SSH tunnel logic a few days ago. Please update to the latest build if not already done and try again.
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
I was on a 7x version. After the issue arose I updated to the latest. Still did not fix the issue. unhappy
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
I am currently on 8.3.0.4749, and only one session created, which is the one with ssh tunnel to my aws host.

Still simply connects to my localhost. unhappy
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
Tried making a brand new session for the ssh tunnel to aws, and still same result, connects to localhost.
ansgar's profile image ansgar posted 11 years ago Permalink
Ok. Did you perhaps enter "localhost" into the "SSH host" on the ssh tunnel tab?
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
Heh no, I checked that first of course.

I have been using the connection for over a year, so that session had not changed. Only change came after I added the local MySQL install.

And I created a new session. The SSH tunnel host is definitely going to my AWS elastic IP.
ansgar's profile image ansgar posted 11 years ago Permalink
And you're passing a SSL certificate? As far as I know Amazon requires that. See issue #2336 for postings from other users which can connect to AWS.
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
So I am running Win7, went into service and stopped MySQL.

Now HeidiSQL will connect normally to my DBs on my AWS host.
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
Yeah, so weird.

If I start my Local version of MySQL 5.6 up, Heidi goes right back to connecting to localhost.

It's like it first looks at localhost, before starting the SSH Tunnel, and if it gets a localhost connection it stops before trying the SSH tunnel first.

just a guess, nothing else but based on what it seems to be doing.
ansgar's profile image ansgar posted 11 years ago Permalink
Do you use the port 3306 as "Local port" in HeidiSQL's SSH tunnel tab? If so, your local MySQL server also runs on 3306 and gets precedence when you run it, while plink.exe does not "overwrite" it. You should use a different local port in Heidi's local port, let's say 3307.
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
port 3307 is used on the SSH tunnel tab.
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
[expired user #7361]'s profile image [expired user #7361] posted 11 years ago Permalink
But both DBs, on the remote host and local have the same root pw. Thus why they can both open from one session configuration.
ansgar's profile image ansgar posted 11 years ago Permalink
Yes, the same password explains why your connection is not refused on localhost, but it does not explain why you're routed to localhost instead of the specified ssh host. To be honest, I have no clue. You could try to run the plink command by hand and see if that fails:
C:\whatever\plink.exe -ssh yourusername@ec2-54-243 -pw "yourpassword" -N -L 3307:ec2-54-243:3306
[expired user #7953]'s profile image [expired user #7953] posted 11 years ago Permalink
Same problem here. I have two connections to different servers (via SSH, with different passwords). If i connected to one server, and try connect to other, i got same tables:



But if i disconnect from first server and connect to other, all right:



Seems like SSH tunnel settings don't load if connection already estabilished.

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