Bug #43064 TCP connections to localhost are not supported
Submitted: 20 Feb 2009 17:35 Modified: 31 Mar 2009 12:45
Reporter: Daniel Kulesz Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Administrator Severity:S4 (Feature request)
Version:5.1 OS:Linux
Assigned to: CPU Architecture:Any

[20 Feb 2009 17:35] Daniel Kulesz
Description:
I am using the mysql-administrator to connect to a remote mysql database tunneled over SSH. Due to the tunneling approach, the database is reachable on "localhost" but with a different port number. With the mysql cmd line client, the following line works:

mysql --protocol=tcp --port=5050 --host=localhost -u myuser -p

Once I leave out the --protocol option, the client assumes my DB is reachable via UNIX sockets. This is okay so far.

Now when I try the same with the GUI tools (i.e. mysql-admin) this fails, since the connection type is not configurable. I didn't see a switch to supply the protocol type, so I tried to supply the -c switch (which stands for connection according to the --help output):

mysql-admin -ctc

Unfortunately the effect remains the same, I can't connect.

Ugly workaround: define a mapping in the hostsfile (i.e. /etc/hosts) pointing to the local loopback device:

127.0.0.1 mymachine

Now connecting to the DNS "mymachine" works, since the tool assumes it's a remote connection and chooses the TCP protocol instead of UNIX sockets.

How to repeat:
Open a ssh tunnel to a remote machine with a running mysql server, i.e.:

ssh -N -f -L5050:localhost:3306 someuser@mysqlserver

Fire up mysql-admin and try to connect to localhost, port 5050

Suggested fix:
Add an option to choose the protocol type in the "advanced" tab (preferred) or add a working --protocol= command line switch (not preferred)
[20 Feb 2009 18:43] Valeriy Kravchuk
Why not to use 127.0.0.1 instead of localhost? Read http://dev.mysql.com/doc/refman/5.1/en/connecting.html.

Anyway, support of --protocol equivalent for GUI tools is a reasonable feature request.
[20 Feb 2009 18:46] Daniel Kulesz
Sounds reasonable - and yes, having such an option would make things easier.
[24 Mar 2009 14:44] Susanne Ebrecht
Many thanks for writing a feature request. We are on the way to implement full functionality of MySQL Administrator into MySQL Workbench.

We won't implement this feature into MySQL Administrator anymore. But --protocol is a good idea for MySQL Workbench too. So I will change this to a Workbench feature request.
[31 Mar 2009 12:45] Susanne Ebrecht
Many thanks for writing a bug report. We are on the way to implement full functionality of MySQL Administrator into MySQL Workbench. We won't add this feature request anymore.

More informations about MySQL Workbench you will find here:

http://dev.mysql.com/workbench/