几个小时后,我一直失去与MySQL服务器的连接

发布于 2025-02-09 17:02:18 字数 292 浏览 0 评论 0原文

我有一个python脚本,它可以作为生产线的计数器,它基本上记录了产品通过传感器光束。除此之外,该代码还具有两个线程,可以作为计时器,用于完成MySQL连接何时完成。这是每分钟一次,一个小时。问题在于我不断遇到网络错误,例如

果酱致命错误:网络错误:软件导致连接中止。和 mysql.connector.errors.interfaceError:2003:无法连接到“ IP:port”(101网络不可到达)上的mySQL Sever,

这引起了为什么它显示该消息的问题?由于网络已启动并可用,因此在运行几个小时后发生,该脚本应该整天运行。

I have a python script which works as a counter for a production line that it basically records a product has passed through the sensor's beam. Aside from this, the code has two threads that works as timers for when the MySQL connection is done. Which is one time every minute and once an hour. The problem is that I keep getting network errors, such as

PuTTY Fatal Error: Network Error: Software caused connection abort. And
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL sever on "IP:port" (101 Network is unreachable)

Which rises the question on why it displays that message? Since the Network is up and available, this happens after some hours after running, the script is supposed to run throughout all day.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文