英文:
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
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论