OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: using mysql over ssh
From: Adam Laurie (adamalgroup.co.uk)
Date: Thu Apr 20 2000 - 05:33:36 CDT


Dan Langille wrote:
> >
> > Open two terminal windows...
> >
> > In window one, do:
> >
> > ssh -L 3306:localhost:3306 usermydomain.org
> >
> > In window two, do:
> >
> > mysql -h localhost -u userid -p dbname < mysql.sql
> >
> > the mysql client will tunnel it's connection to the remote server, and you
> > will be prompted locally for the password (if you're using an up to date
> > copy of mysql). You can also use this method for an interactive session...
> >
> > You will need to have the remote server up to use MYSQL_TCP_PORT instead of
> > the default MYSQL_UNIX_PORT, and it's a good idea to bind it to loopback to
> > that only local or tunneled clients can connect.
>
> What is the point of two windows?

The first one gives you an ssh tunnel. The second one uses the tunnel.

>
> Note: the goal is to put all of this into a script. It will not be interactive.
> There will be nobody there to reply to a prompt. That's why I like the
> ~/.my.cnf entry so much.

I would go with that then. Just make sure it's owner-readable only.

cheers,
Adam

--
Adam Laurie                   Tel: +44 (181) 742 0755
A.L. Digital Ltd.             Fax: +44 (181) 742 5995
Voysey House                  
Barley Mow Passage            http://www.aldigital.co.uk
London W4 4GB                 mailto:adamalgroup.co.uk
UNITED KINGDOM                PGP key on keyservers

To Unsubscribe: send mail to majordomoFreeBSD.org with "unsubscribe freebsd-security" in the body of the message