Bug #85565 SQL editor could not be connected: Lost connection to MySQL server during query
Submitted: 21 Mar 2017 12:58 Modified: 27 Jul 2017 13:12
Reporter: Yashwanth Aluru Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:6.3.9, 8.0.28 OS:Windows (Microsoft Windows 7 Professional Service Pack 1)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[21 Mar 2017 12:58] Yashwanth Aluru
Description:
Hi,

Recently, I updated my existing Workbench commercial 6.3.8 trail to MySQL Workbench Commercial (Proprietary) for Windows version 6.3.9 SE build 10690321 (64 bit). I got all my old connections saved but I cannot open any of them and I get an error "Lost connection to MySQL server during query". Nothing was wrong from the server side as it always listens to my IP address.

This is not the case all the time. Sometimes the connection attempt is successful and frequently it is not. To test this, I degraded my Workbench to previous version 6.3.8 and I am able to make all the connections successfully.

How to repeat:

MySQL Workbench Commercial (Proprietary) for Windows version 6.3.9 SE build 10690321 (64 bit) on Windows. Try getting connected to your older connections or newly made connections.

It throws an error "Lost connection to MySQL server during query". It is thrown often. If you're lucky enough you can get connected sometimes.

Now, degrade your Workbench to 6.3.8 and try getting connected to servers. You'll be successfully getting connected to the servers.

Suggested fix:

It should be establishing connections successfully
[21 Mar 2017 18:45] MySQL Verification Team
Thank you for the bug report. Please provide the wb.log using the Files tab (private if you wish). Use Help->Locate Log files for. Thanks.
[24 Mar 2017 22:10] MySQL Verification Team
Please try to connect with the mysql.exe command client using the same parameters of connection used with WorkBench. Thanks.
[27 Mar 2017 7:30] Yashwanth Aluru
I'm able to get connected through the command line client, using MySQL.exe
[27 Mar 2017 22:31] MySQL Verification Team
According the wb1.1log you attached the connection with root user failed (the hostname for password looks wrong). See the lines:

18:04:46 [ERR][SQL Editor Form]: SQL editor could not be connected: Lost connection to MySQL server during query
18:04:46 [ERR][SQL Editor Form]: Your connection attempt failed for user 'root' from your host to server at ::
  Lost connection to MySQL server during query

Please:
1 Check that mysql is running on server 
2 Check that mysql is running on port  (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to  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  connecting from the host address you're connecting from

So check if your saved connections file isn't corrupt or create a new connection with same parameters worked with the command line client.
[28 Mar 2017 7:29] Yashwanth Aluru
I tried the thing you said before posting this issue. I deleted all my saved connections and created new connections still the issue is same.

I upgraded workbench from 6.3.8 to 6.3.9 and all my saved connections of previous version appeared in the latest version. If what you said is to be considered then how come it works when I downgraded 6.3.9 to 6.3.8?

All the servers defined in my workbench are accessible from my IP. Surprising thing is, I'm able to get connected to my servers at one moment. If I close that connection and try to open again then I won't be able to get connected. This is the reason behind posting this bug. :)
[27 Jul 2017 13:12] Chiranjeevi Battula
Hello Yashwanth Aluru,

Thank you for the feedback.
I could not repeat the issue at our end using with MySQL workbench 6.3.9 community and commercial versions.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Thanks,
Chiranjeevi.
[16 Mar 2022 14:15] MySQL Verification Team
Bug #106667 marked as duplicate of this one.