在同一台笔记本电脑上出现MySQL连接问题

huangapple go评论130阅读模式
英文:

Mysql bad connection on the same laptop

问题

我在使用OpenServer的本地MySQL服务器进行Golang开发。

有时候我会看到"driver:bad connection"的错误...
这可能是什么原因导致的呢?

我使用的是Windows 10操作系统,OpenServer版本是5.2.2,MySQL服务器版本是5.6-x64,Golang版本是1.7.4,Ozzo-dbx版本是1.0.6。

英文:

I use local mysql server from OpenServer for developing on Golang.

Sometimes I see errors "driver:bad connection"...
What may cause this problems?

Windows 10, OpenServer 5.2.2, Mysql server 5.6-x64, Golang 1.7.4, Ozzo-dbx 1.0.6

在同一台笔记本电脑上出现MySQL连接问题

在同一台笔记本电脑上出现MySQL连接问题

答案1

得分: 0

我对自己的问题有了答案。
根据一项研究,当调试器停在断点上时,会出现这种情况。
之后,我检查了OpenServer中的MySql设置文件,并找到了wait_timeout参数。然后我在MySql官方网站的http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout上查看了文档,并找到了该参数的默认值(在OpenServer中为28800,而不是5)。当我将设置更改为默认值时,问题消失了。

英文:

I have the answer for my own question.
According to a study, this situation appear when debugger stops on breakpoints.
After this, I checked settings file for the MySql in OpenServer and found
wait_timeout parameter. Then I checked documentation on MySql website at http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_wait_timeout and found default value for this (28800 instead 5 in OpenServer). When I changed the setting to the default value, the problem disappeared.

huangapple
  • 本文由 发表于 2017年1月17日 06:52:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/41686318.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定