Bug #59520 Connection failure on third and subsequent connection attempts
Submitted: 14 Jan 2011 23:21 Modified: 1 Sep 2011 22:09
Reporter: Rick Francis Email Updates:
Status: Closed Impact on me:
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.31, 5.2.33, 5.2.33 OS:MacOS (10.6.6)
Assigned to: CPU Architecture:Any

[14 Jan 2011 23:21] Rick Francis
When opening connections to multiple databases, I rarely can open more than two connections without getting "Cannot Connect to Database Server - SQL logic error or missing database". All further attempts to open a connection to any server gets this error. Exiting and restarting Workbench allows me to make the connection, but again, I can't have more than two open connections.

This problem first appeared in 5.2.31.

The MySQL servers are all version 5.1.50 running on CentOS 5.3.

How to repeat:
Add new database connections for at least three servers. Attempt establish a connection to each of these servers one at a time. At some point, usually when attempting to open the third server, you'll get "Cannot Connect to Database Server - SQL logic error or missing database".
[15 Jan 2011 19:22] Rick Francis
Switched to 5.2.30 (which I had previously skipped when upgrading to 5.2.31) and it exhibits the same problem. Switched back to 5.2.25 and the problem disappeared.
[1 Feb 2011 13:28] Johannes Taxacher
Hi Rick,
does this happen when trying to connect query-sessions or when launching multiple administration instances? (i cannot reproduce the problem on my 10.6.6 MBP here)
could you also add the information of your Workbench's help->system info
thanks in advance
[2 Mar 2011 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[16 Mar 2011 19:44] Bob Obringer
I had the same problem but it was reproducible 100% of the time.

Was using 5.2.31 (OSX) for several weeks without any issues.  All of a sudden over the last two days, I couldn't open connections to more than one server without ANY sql request failing.  Just right clicking on a table and saying "Select Rows" caused a failure.  Upgrading to 5.2.33 resulted in the same issue.

I moved the settings stored @ ~/Library/Application Support/MySQL/Workbench and let it reset all of my settings.  That did the trick... so it's something going on there.
[20 Mar 2011 4:53] Rick Francis
Problem still existed after upgrading to 5.2.35. Following Bob Obringer's advice, I deleted ~/Library/Application Support/MySQL/Workbench and re-added all my saved server connections. The problem went away.
[20 Mar 2011 4:59] Rick Francis
Should have said 5.2.33 in previous comment rather than 5.2.35.
[9 Jun 2011 14:45] Alfredo Kojima
Rick, please check if version 5.2.34 still exhibits the problem.
[9 Jul 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[2 Aug 2011 16:04] Sam Drori
I also encountered this problem running Workbench 5.2.33 on Mac Os X.  The problem definitely began after I upgraded to that version (not sure which version I was running previously - presumably the one that was current back in March, 2011).

Reading the comments here I upgraded to 5.2.34 and the problem is still there.  In fact I can only open ONE SQL editor connection at a time (multiple editor documents, only one server connection). 

Even when I can connect to a second server I often get this message from the first connection when I try to run a query afterwards: Error: SQL logic error or missing database (the query editor starts the query and reports "Fetching..." in the Output-Actions tab, but then immediately adds a second record with the Error message.

Just wanted to let everyone else know they are not imagining the problem,  and to let the moderator(s) who keep trying to close the thread that the problem is still present, even in the very latest version of Workbench.
[3 Aug 2011 23:45] Alfredo Kojima
Was able to repeat after a couple of connections.
Bug #62029 is also a duplicate
[4 Aug 2011 15:05] Steve Wollkind
I am here after having first found the duplicate bug.  On my system (5.2.34, Mac OS X 10.6) I can reproduce this every time with the following steps:

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

You get the "Cannot connect" error window with the unhelpful suggestions of:

 SQL logic error or missing database
   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
   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

If you close the open connection and retry to open the second one, it works fine.  

I'm unhappy that this is the preferred bug here because the severity is higher than non-critical.  This makes Workbench basically useless to me as I don't want to close sessions and have to save/load work in progress every time I need to talk to a different database server.
[4 Aug 2011 15:06] Steve Wollkind
Also, the title of this bug is misleading if it is truly a dupe of 62029, as it happens not on 'third and subsequent' connections, but any time you try to open a second concurrent connection.
[4 Aug 2011 18:01] Alfredo Kojima
Anyone experiencing this, how many files do you have in ~/Library/Application\ Support/MySQL/Workbench/sql_history/ ?

If you move the contents of that dir to somewhere else temporarily, does it make any difference?
[4 Aug 2011 18:05] Steve Wollkind
I had 141 files.  After moving them, the issue seems to be resolved.  Very interesting.  Well, that's an acceptable workaround for me for now.  Any idea what the threshold number is for the issue to appear?
[8 Aug 2011 18:31] Mike Reid
Note, I have 178.

I _really_ don't want to lost my SQL history, so I've archived them to a temporary location.

I can confirm that this temporary work-around does indeed fix the "limited connection" issue I was experiencing :) ...can't wait for the next version with this fix so I can restore my SQL history and maintain multiple active connections.

Thanks so much!
[13 Aug 2011 20:39] John Withnall
Removing the files from ~/Library/Application Support/MySQL/Workbench/sql_history resolved this same problem for me.  Thanks for this.
[14 Aug 2011 11:29] Sam Drori
Removed all the files form that folder (not sure how many I had - but it was well over 100) and that solved the problem for me as well.
[1 Sep 2011 22:09] Philip Olson
Fixed as of 5.2.35:

+        &workbench; would not connect to multiple database connections
+        when the <literal>sql_history</literal> folder was too large. A
+        workaround was to delete the <literal>sql_history</literal>
+        folder.