Connecting to MySQL using DBTools and PuTTY

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there,

I have a problem connecting to a remote MySQL database via SSH using
DBTools and PuTTY. The problem is described below and I am really
hoping you can help!

In short I can connect to the mysql db when logging in via putty BUT
when I try to log in via DBTools I get an error message "Lost
connection to MySQL server during query". Details of what I've set up

The Server I'm connecting to
The mysql database cannot be connected to directly however the hosting
company do offer full SSH access. For reference the connection details
I have are (say) as follows:

User: user_SSH
Pass: pass_SSH

Port: 3306
DB:    database_name
User: user_SQL
Pass: pass_SQL

What I have set up on my computer (client)
I am running windows server 2003. It has ZoneAlarm installed but I have
tried turning this off etc just in case this was causing a problem
however this makes no difference.

SSH Tunnel:    L3306    localhost:3306    (with Local and Auto radio boxes
(Then I log in using)
Passowrd:    pass_SSH

Engine:    MySQL
Name:        some_name_here
Hostname:    localhost
Port:        3306
User ID:    user_SQL
Passowrd:    pass_SQL
Database:    database_name

I have tried various options for using DBTools but I just can't connect
correctly. It would seem that I need to specify the MySQL Host address
somewhere ( but I'm not quite sure where?! I have
tried using "" in the Tunnel instead of
"localhost:3306" but this doesn't work. I have tried incorporating it
into the DBTools user id or database name using
"" etc but again this doesn't seem quite

Logging in to putty and typing the following does get me into the MySQL

Quoted text here. Click to load it

Therefore I know I can connect, it is just a problem when using DBTools
- particularly as I don't know where to specify the mysql host address
(as I use localhost in order to use ssh!).

Hope you can understand what I'm trying to say and suggest how I may
resolve the problem.

Very many thanks for your time.

Re: Connecting to MySQL using DBTools and PuTTY

w_searle wrote:

Quoted text here. Click to load it
Tunnel:        L3306        localhost:3306        (with
Local and Auto
Quoted text here. Click to load it

Are you telling the tunnel to connect, on the server side, to the machine
running MySQL?  I don't see that expressed above, and that is a necessary
part of the setup.

Quoted text here. Click to load it

Is MySQL running on the same server as the SSH server?  In that case,
localhost:3306 may be fine.  

Is MySQL listening on the SSH server's localhost address on port 3306?  When
we set up MySQL, our default is to do so with TCP listen()ing off (ie. only
using the named pipe).  Perhaps your MySQL is configured the same way?  If
so, that must be changed.

I've users tunneling to various services including MySQL, and there's never
been a problem (beyond getting them to switch to SSH; there seems to be
great love of sending passwords around unencrypted {8^).

 - Andrew

Site Timeline