MySQL Workbench 6.3(Mac)挂起在简单查询上

我使用 MySQL Workbench 6.3.7 build 1199 CE (64 bit)在 Mac 上,OS X Yosemite 10.10.5。我正在连接到一个 Amazon RDS MySQL 实例。

输入简单查询时,如

select * from `devices`;

然后点击带光标的闪电图标,查询开始,在下面的屏幕快照中,“ SQL File 4”选项卡旁边的旋转器激活指示查询。但是,查询不会完成,它只是挂起。禁用了红白相间的停止标志图标。

screenshot of MySQL Workbench in hung state

从现在开始,我只能强制退出 MySQL 工作台。如果我试着经常戒烟,什么都不会发生。

如何在数据库上始终如一地运行一个简单的查询?有时候它能起作用(大概10% 的时间) ,但大多数时候它只是挂起来。

32724 次浏览

To resolve this issue, I downgraded MySQL Workbench to 6.1. Now I am able to run my query and it doesn't hang.

This seemed to help some of the time, but not 100%: Connect to the database with a different user, and then re-connect with the original user.

I'm about to downgrade like the accepted answer says though, as this doesn't solve it every time.

I found that if you use the latest 6.3 version, that in order to get queries to work, you have open a first connection and ignore it and then open a second connection. This creates two tabs in the workbench. If you perform your queries in the second tab, it works. If you try in the first tab, it hangs.

I also have found that you have to do a force quit the workbench.

I hope the mysql folks get this fixed.

I found that deleting the cache and workspaces folder contents (~/Library/Application Support/MySQL/Workbench) it works again. What I haven't found is how to ensure it doesn't hang again :-(

I also found that if I manually close the Connection tab from the menu and exit WB from the menu and not from the OS window buttons it seems more stable next time.

PS: I am using SSH connection so it may be due to this but it is not always happening.

UPDATE: A clean install and no SSH configurations the issue still persists. Unless you manually go and delete the cache folder files it continues to hang.

In my case, it was changing the connection->ssl->Use SSL setting from "If available" to "No". Workbench 6.3.8 on OSX 10.12.1 now works for me.

UPDATE 3: The problem is fixed for MacOS HighSierra in MySQL Workbench 6.3.10.

UPDATE 2: It looks like the bug is recurring again in MacOS HighSierra. See https://bugs.mysql.com/bug.php?id=83658 for more details.

There is an unofficial build that fixes the problem. You can download it at: https://drive.google.com/drive/folders/0B2fTesDcrHzVRGVFWEdILWpuaEE?usp=sharing

The build was created by Bob Davenport. See https://bugs.mysql.com/bug.php?id=87714 for more details.


UPDATE: The bug is fixed in MySQL Workbench 6.3.9.

----------------------- original answer -----------------------

It is a known MySQL bug: http://bugs.mysql.com/bug.php?id=83658 caused by GateKeeper Path Randomisation introduced in MacOS Sierra. See https://weblog.rogueamoeba.com/2016/06/29/sierra-and-gatekeeper-path-randomization/.

A possible workaround is to remove the Quarantine ACL:

xattr -dr com.apple.quarantine "/Applications/MySQLWorkbench.app"

I was getting around the problem for awhile by deleting the user library folder and dropping back to version 6.2.5 ... but today found the problem was back. So today I deleted the user library folder and dropped back to version 6.1.7. It's working again, for now.

In my case, the IP address changed where mySQL was served. Flushing the DNS fixed it for me:

sudo dscacheutil -flushcache;
sudo killall -HUP mDNSResponder;
say cache flushed

The spinning wheel of death is due to the new feature introduced in the Sierra update called "Gatekeeper Path Randomization".

Follow the instructions:

  • Open MySQL Workbench :)
  • Right click on your connection (most likely “localhost” or “127.0.0.1”)
  • Choose “Edit connection”
  • On the right hand window select “Connection > SSL”
  • Change “Use SSL” from “If available” to “No”
  • Now click on the tab “System Profile”
  • Choose “MacOS X” as System Type
  • Click “Test connection”

Credits: http://cordobo.com/2398-mysql-workbench-6-3-macos-sierra-hangs-on-simple-queries/

This is still an open bug in 6.3.8: https://bugs.mysql.com/bug.php?id=82231

The possible workaround is to open secondary tab with the same connection and work in there. However it crashes anyway from time to time.

Until the bug is fixed I use free Mysql Workbench aleternative for common work. For mac users I would suggest https://sequelpro.com.

The version 6.3.9 solved the problem, but this version is not showing in "Check for upgrades" option, you need to download directly from the site.

MySQL Workbench official download page

6.3.9 fixed the issue in the mac. Here is the link MySql 6.3.9

Upgrade to 6.3.9 fixed the issue. The 6.3.4 was hanging on queries for me. Unfortunately the Help > Check for Updates didn't indicate any updates were available, so I went to the source.

  1. At last I have downloaded MySQL Workbench 6.3.10 and install MySQL Workbench 6.3.10 and solved my problem. I have downloaded MySQL Workbench 6.3.10 from bellow link https://dev.mysql.com/downloads/workbench/

  2. It is working for me.. I think this will work for you..

This can probably help as a temporary/immediate solution. If I try to manually type the below query, MySQL Workbench hangs, especially at x.*

SELECT
x.*
FROM x_table x;

But if I write the SQL in another editor and paste it in MySQL Workbench and run the query, it doesn't hang.

Versions: MacOS Big Sur (11.2), MySQL Workbench 8.0