Bug #62029 Workbench Connection Limit: Only One Active? (Cannot Connect to Database Server)
Submitted: 29 Jul 2011 16:55 Modified: 8 Aug 2011 18:34
Reporter: Mike Reid Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.34 OS:MacOS (OS X 10.5, 10.6, 10.7)
Assigned to: CPU Architecture:Any
Tags: Connection, limit, ssh, tunnel

[29 Jul 2011 16:55] Mike Reid
Description:
Since the last few versions of Workbench (including the latest), all of my stored connections (using SSH Tunnels, aka "Standard TCP/IP over SSH") excluding a few locally defined connections, can no longer be used at the same time...Workbench limits you to one active connection at a time, which never used to be the case. :(

All of the connection are configured correctly -- and connect without issue INDIVIDUALLY -- but attempting to open more than one of the connections at the same time produces the following error:

--------------------

  Cannot Connect to Database Server
  Your connection attempt failed for user 'my_username_here' from your host to server at db:3306:

  SQL logic error or missing database

  Please:

   1 Check that mysql is running on server db

   2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)

   3 Check the mbreid has rights to connect to db from your address (mysql rights define what clients can connect to the server and from which machines) 

   4 Make sure you are both providing a password if needed and using the correct password for db connecting from the host address you're connecting from

--------------------

NOTES:

- SSH Connection is configured using public SSH Key file.
- SSH is configured on a non-standard port (NOT port 22):

  [Parameters]

  SSH Hostname: "my_mysql_server:1234"
  SSH Username: "my_username_here"
  MySQL Hostname: "db"
  MySQL Server Port: "3306"
  Username: "my_username_here"
  Password: [stored in Keychain]
  Default Schema: [defined]

  [Advanced]

  Use SSL if available is Enabled

- "db" is a custom hostname defined in /etc/hosts pointing to a private, internal IP address.
- "my_username_here" is the SAME username on Mac OS X as it is for the server SSH account, as it is for MySQL user/permission.

--------------------

I have many Connections defined, specifically two Production servers and one Development server.
On EACH server, the credentials/ports, etc are all the same...the problem is, I cannot connect to more than one connection at a time.
Even if I try connecting to a local MySQL database on my Mac (no SSH tunnel required), the same error comes up:

 Cannot Connect to Database Server
 Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:  SQL logic error or missing database

How to repeat:
1. Download latest Workbench for Mac
2. Create a few Connection profiles for a few different MySQL servers (some using SSH Tunnels)
3. Connect to each of the profiles (individually) to ensure they work, closing them before testing another.
4. Now, try connecting to more than one profile at a time, leaving at least one other connection active)
5. Watch for the "Cannot Connect to Database Server" error

----

6. Close all open connections
7. Re-try connecting to any connection profile and watch it Succeed without issue.

[repeat from step 4]

Suggested fix:
Restore functionality to allow MULTIPLE active sessions.

As it stands the only workaround is to close the active connection, then connect another one. It makes usability via Workbench extremely challenging when managing multiple database servers, Production/Development, etc.
[31 Jul 2011 15:53] Valeriy Kravchuk
I had not problem like this on Mac OS X 10.5.x trying to connect via SSH tunnels to *local* MySQL server both via localhost or any other IP address of local network interface. 

Please, confirm that all connections in your case are to other, remote machine.
[31 Jul 2011 16:30] Mike Reid
Yes, as I mentioned, all of my stored connections are remote via ssh tunnel (excluding one, which is *localhost*, no ssh tunnel.)

The connections ALL work just fine when ran INDIVIDUALLY, but the second I try to run more than one at a time, I receive Cannot Connect to Database Server error. It's really frustrating.

I _think_ the common thread may be SSH tunneling here, but have not been able to confirm.
[3 Aug 2011 14:10] Steve Wollkind
I am experiencing the same issue, though my connections are not over any SSH tunnel, they are direct to the database servers on my network.  Version 5.2.34 on Mac OS X 10.6.

If you:
1 define multiple stored connections
2 connect to one of them
3 try to connect to a second

you will get the "Cannot Connect to Database Server" window with the error message as described above.  

If you close the open connection and try to open the second one, it will work, so it really does seem like we're being limited to one open connection as a new "feature."  Is this intentional?

This is extremely annoying, as I routinely need information from various of our database servers, and repeatedly closing connections to work between different servers is not a great workaround.
[3 Aug 2011 15:07] Mike Reid
Great to know, Steve. I was starting to think this was just happening to me, something possibly specific to my setup. I'm also glad you were able to rule out the SSH tunnel piece.

I find myself checking the MySQL Workbench Blog (http://wb.mysql.com/) daily looking for the next possible release, hoping that this bug specifically will have been addressed.

Can someone at Oracle please verify this on their end to get this into the queue ASAP?
[3 Aug 2011 23:45] Alfredo Kojima
Duplicate of bug #59520
[8 Aug 2011 18:34] Mike Reid
Temporary solution posted here: http://bugs.mysql.com/bug.php?id=59520#c368389 seems to do the trick!

Thx Alfredo :)