当空闲时,MySQL Workbench会丢弃连接 [英] MySQL Workbench drops connection when idle
问题描述
我在我的OS X 10.9.5上使用MySQL Workbench 6.3来管理多个云数据库(托管在Rackspace上),我遇到以下问题:
I'm using MySQL Workbench 6.3 on my OS X 10.9.5 to manage several cloud databases (hosted on Rackspace), and I get the following issue:
当非活动状态持续5分钟时,会出现以下问题:
When inactive for 5 minutes, the following problems happen:
- 我无法运行任何查询(错误2013:
- 尝试浏览我的数据库上的表时,我收到类似无法提取表,无法获取视图等信息。
- 刷新左侧面板时,出现错误代码:2006 MySQL server was gone away
基本上连接已经消失。
这真的很烦人,因为它发生后只有5分钟的不活动。因此,我需要关闭连接并每次重新打开。
This is really annoying since it happens after only 5 minutes of inactivity. Therefore I need to close the connection and reopen it each time.
我也试过这样: MySQL Workbench:如何保持连接活着,这没有改变任何东西。
在我的Workbench Preferences选项卡中,我有以下设置:
I also tried this: MySQL Workbench: How to keep the connection alive, which didn't change anything. In my Workbench Preferences tab, I have the following setup:
- DBMS连接保持活动间隔
- DBMS连接读取超时(以秒为单位):600
- DBMS连接超时(以秒为单位):60
请注意,在非活动5分钟后,发生此问题。如果我以4'59分钟的间隔运行两个查询,精细。
我的同事连接到他们的Workbench上的同一个数据库没有这个问题。
Notice that this issue happens precisely after 5 minutes of inactivity! If I run two queries in a 4'59 minutes interval it works perfectly fine. Also my colleagues who connect to the same database on their Workbench don't have this issue.
有没有人有这个解决方案?
Does anybody have a solution for this?
推荐答案
进入编辑 - >首选项 - > SQL编辑器,你会看到:
Go to Edit -> Preferences -> SQL Editor and there you'll see:
DBMS connection keep-alive interval (in seconds): 600
DBMS connection read time out (in seconds): 600
DBMS connection time out (in seconds): 60
DBMS连接保持活动间隔表示Workbench发送保持活动请求
The DBMS connection keep-alive interval means how often Workbench sends keep-alive request to the server to keep the connection alive.
由于5分钟== 300秒,
设置DBMS连接保持活动间隔< 300(例如250)
Since 5 minutes == 300 seconds, set DBMS connection keep-alive interval < 300 (e. g. 250)
这意味着每250秒发送保持活动请求。单击确定。
It will mean "send keep-alive request every 250 seconds". Click OK.
然后退出MySQL Workbench并重新启动它以使更改生效。
Then quit MySQL Workbench and relaunch it to make the changes take effect.
标准TCP / IP通过SSH连接方法,它也可以有助于配置ssh ServerAliveInterval以及。
If you use Standard TCP/IP over SSH connection method, it's also can be helpful to configure ssh ServerAliveInterval as well.
这篇关于当空闲时,MySQL Workbench会丢弃连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!