Bug #65527 "Connection Cancelled" message connecting to local DB
Submitted: 6 Jun 2012 1:02 Modified: 6 Jun 2012 1:13
Reporter: Corey Yeatman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.2.40 OS:Windows (Windows 7 (VM))
Assigned to: CPU Architecture:Any
Tags: cancelled, Connection, localhost

[6 Jun 2012 1:02] Corey Yeatman
Description:
I have MySQL 5.5.24 and MySQL-Workbench 5.2.40 installed on a Windows 7 VM. MySQL is working fine; can connect as root and other users to it using the command line client. 

However - the MySQL Workbench seems to have some sort of intermittent problem with connecting to the localhost DB to start a query. It connects about 1 attempt in every 20, and the rest of the time it just attempts to connect to the database on localhost:3306 (and does ask for a password), but then just aborts and comes up with the message "Connection cancelled" in the bottom left-hand corner of the window. 

If I test the connection via the "Manage Connections" option, it says everything is correct. The command-line client also comes up if selected via the "Start Command Line Client" option. The Server Administration window will come up every time as well. 

I also tried putting the 5.2.40 workbench on *another* Windows 7 PC and connecting to the DB on the VM, and this worked fine. I've tried repairing my workbench installation but that hasn't helped.

I also tried connecting the MySQL-workbench instance on the Windows 7 VM to a MySQL DB running on another server and that was fine too.  The issue seems to only exist with the workbench connecting to the local DB.

The general logs and error logs don't seem to give much of a clue as to what is going on when the connection is cancelled.

There is either something wrong with the networking on the windows 7 VM (although everything else works fine) or some sort of bug with local connections.

Issue was raised in the forums before reporting it as a bug:
http://forums.mysql.com/read.php?152,541931,541931#msg-541931

How to repeat:
- Install MySQL 5.5.24 on Windows 7
- Ensure MySQL command-line (DOS window) can connect to the local DB
- Install MySQL-Workbench 5.2.40 on Windows 7
- Try connecting the workbench to the local DB

Suggested fix:
Unsure of a fix, but if it could at least log why the connection was cancelled when the issue occurs, then it would assist users with tracking down the problem (if it should happen in future).
[6 Jun 2012 1:13] Corey Yeatman
Of course, now that I've reported it, MySQL Workbench has made a liar out of me and the issue has righted itself!  :-)

I have no idea what has "fixed" it, as the machine has been rebooted multiple times while the issue was occurring (having spent half a day trying to fix it originally), there have been no network changes, and no major windows updates applied - so I'm in the dark as to what was causing it.

Is there any way to make MySQL at least log what causes a "Connection Cancelled" error?
[28 Jun 2012 22:57] Brian Vogler
I have this problem

Installed MySql on Window 7 32x or Windows Server 2003 32x (both VM's)
When I open connection to localhost get "connection cancelled".  When I retry opening the connection it works on the 2nd or 3rd try.
[30 Jul 2012 10:09] John Herrick
I had this issue constantly on a Windows 2008 R2 server VM. I noticed the memory on the server was close to maximum and I upped it on the VM from 1GB to 2. It now works constantly. 

Obviously this might not be a workaround available to everyone but hopefully it will allow the developers to identify the defect.