On Sun, Jan 20, 2002 at 12:01:29AM +0100, Henning Sprang wrote:
>
> Hy all,
>
> i am just trying to tunnel a mysql client connection via ssh.  i am
> behind a firewall that doesn't let mysql connections through to the
> outer world.
> 
> But i can do ssh to the host i want connect to. Tunneling http port 80 
> with the command
> 
> ssh [EMAIL PROTECTED] -L 80000:localhost:80
> 
> gives me access to the http port of the remote machine via port 80000 on 
> my local machine.
> 
> so fra , so good. Then doing
> 
> # ssh [EMAIL PROTECTED] -L 80000:localhost:3306
> 
> 
> and connecting to port 80000 on my machine with telnet gives me 
> something like
> 
> Trying ::1...
> Connected to localhost.
> Escape character is '^]'.
> ,
> 3.23.47-log$jhbjhb%kj
> 
> which i suppose is a prompt from the remote mysql service

Yes, that means it's working.

> but then trying to connect to that port with the mysql client i get:
> 
> # mysql -u username -p -h my.local.hostname -P 80000
> Enter password:
> ERROR 2003: Can't connect to MySQL server on 'my.local.hostname' (111)
> 
> could it be that the mysql client does some extra checks, so maybe
> the server sends his real hostname or ip address in binary form
> (thats the signs at the end of the telnet prompt?) and the client
> realizes that he is not connected to that machine, but to another
> and breaks up?  can i, if this is so, disable that check?
> 
> I saw some information which said that forwarding mysql connections
> is possible, but cannot get this to work properly.

Try using "localhost" instead of "my".local.hostname".  Since you
didn't use the `-g' option for SSH, I wouldn't expect what you're
doing to work. See the SSH docs for why.

Jeremy
-- 
Jeremy D. Zawodny, <[EMAIL PROTECTED]>
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.41-max: up 17 days, processed 409,667,052 queries (273/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to