[CentOS] ssh port forwarding

Ski Dawg centos at skidawg.org
Thu Jul 12 19:01:14 UTC 2012


On Thu, Jul 12, 2012 at 12:20 PM, Reindl Harald <h.reindl at thelounge.net>wrote:

>
>
> Am 12.07.2012 20:15, schrieb Ski Dawg:
> > Using your string, I can now telnet to port 22222 on localhost (hostA)
> and
> > I get the mysql connection string (from hostB), but it is not able to
> make
> > a mysql connection (using mysql -u user -p -h localhost --port=22222 from
> > hostA), with a test user that I set up to allow connections from
> anywhere.
> > The error that I am getting is:
> > ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> > '/var/lib/mysql/mysql.sock' (2)
>
> learn mysql-basics!
>
> localhost is ALWAYS unix-socket
> the error message is really clear!
>
> use 127.0.0.1 if you want to use TCP which is what happens
> with port-forwarding!
>
>
Thanks. This worked. I have not ever run across this issue before, so I
didn't know that using localhost tied mysql to only a socket connection,
but now I do.



More information about the CentOS mailing list