[PLUG] SSH MySQL and JBuilder 6

Lonnie Wormley launi at zaramyth.net
Tue Mar 19 04:50:44 UTC 2002


On Monday 18 March 2002 09:34 am, Longman, Bill wrote:

Thanks for your reply,  I'm digesting it now.

> > I'm having problems making a SSH connection to port 3306.
> > I'm also trying
> > to set up the new JDBC driver so that JBuilder can connect to MySQL.
> >
> > I have the database up and running and can access it remotely
> > using WebAdmin.
> >  I have Open SSH running on my Mandrake 8.1 server.  When I
> > try to telnet to
> > my server using port 3306 it fails to connect, how do I set
> > an SSH connection
> > using port 3306?
> >
> > ssh -L 3306:username:3306 hostname
>
> I'm surprised this works. The second token of arg 2 should be a host, not a
> user.
>
> I have always found port forwarding rather confusing, so don't think it's
> just you. I've found it easiest to remember that -L is for local
> *connections*.
>
> When I'm at home and I want to connect to my machine at work's port 444, I
> give this command:
>
> ssh -L localPortNumber:myWorkMachine:444 myFireWallMachine
>
> In human language, that says set up a local port on port localPortNumber
> that connects through myFireWallMachine and terminates at port 444 on
> myWorkMachine. Now I just talk locally to port localPortNumber and it's
> like I'm on the machine at work.
>
> You might also throw in "-N -f" as two other args so the connection just
> goes to the background after getting through.
>
> Final ssh really-makes-it-easy caveat: use ssh-agent and ssh-add. When I
> start X, my command is "exec ssh-agent xterm -ls". Then I do "ssh-add
> ~/.ssh/id_rsa" and from there on, any subprocesses have my tokens and I can
> get where I need to without the hassle of password prompts. (Assuming I've
> copied my public key to the remote host...).
>
> > This command works but how do I make this work with MySQL?
> >
> > I've read tutorials and have been scanning the Borland news
> > groups.  I'm
> > missing a concept somewhere and I'm just trying to learn SSH
> > and Java at the
> > same time.  Learning two things at once for me is difficult
> > so some clues
> > would be appreciated.
> >
> > My JBuilder driver
> > org.git.mm.mysql.Driver
> >
> > This is my sample connect string.
> > jdbc:mysql://[hostname][:port]/[dbname] [?param1=value1]
>
> Once you've gotten the connection going, (from my example above), your
> connect string would be something like this:
>
> jdbc:mysql://localhost:localPortNumber/fooDB [?param1=barVal]
>
> > So somehow I have to translate my driver connection into a
> > SSH port on 3306
> > on my server.  All I'm trying to do is work on the JBuilder
> > tutorials from my
> > laptop to my server. My laptop is on different network than
> > my server (two
> > static IPs).
> >
> > If anyone has done this and can help that would be great.
>
> ---------------------------------------------------------------------------
>--- Support PLUG and the Open Source Community
> http://www.linuxfund.org/lugs/?lug=plug To unsubscribe from the PLUG list
> visit http://www.pdxlinux.org/mailing_list/

-- 

____________________________________________
Lonnie Wormley
launi at zaramyth.net          [Linux and Java]
lonnie at launi.com      [Window$ and graphics]
http://www.launi.com http://www.zaramyth.net
____________________________________________




More information about the PLUG mailing list