本文介绍了nodejs mysql 错误:连接丢失 服务器关闭了连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
当我使用node mysql时,在12:00到2:00之间出现一个错误,TCP连接被服务器关闭.这是完整的消息:
when I use node mysql, an error is appear between 12:00 to 2:00 that the TCP connection is shutdown by the server. This is the full message:
有解决方案.但是,我按照这种方式尝试后,问题也出现了.现在我不知道该怎么办.有人遇到过这个问题吗?
There is the solution. However, after I try by this way, the problem also appear. now I do not know how to do. Does anyone meet this problem?
这是我按照解决方案编写的方式:
Here is the way I wrote follow the solution:
推荐答案
尝试使用这段代码处理服务器断开连接:
Try to use this code to handle server disconnect:
在你的代码中,我遗漏了 connection = mysql.createConnection(db_config);
In your code i am missing the parts after connection = mysql.createConnection(db_config);
这篇关于nodejs mysql 错误:连接丢失 服务器关闭了连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!