mysqli.reconnect 是否会重新运行因超时而失败的查询?
最近我注意到 mysql 连接超时,增加 wait_timeout 对此有所帮助。然而它仍然发生。
我们还启用了 mysqli.reconnect 来尝试捕获问题并允许脚本继续运行。然而,我在任何地方都看不到由于超时而运行并失败的 SQL 是否会在重新连接时自动重新运行,正如我所希望的那样。有什么想法吗?
Recently I have noticed that mysql connections are timing out, increasing wait_timeout has helped this. However it still happens.
We have also enabled mysqli.reconnect in an attempt to catch the issue and allow the script to continue running. However I can't see anywhere if the SQL which was run and failed due to a timeout, would automatically get re-run on the reconnection, as I would hope. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读文档,似乎需要使用
mysqli::ping()
来自动重新连接。如果您在任何查询之前运行ping()
,则届时将发生重新连接。Reading the documentation, it seems that you need to use
mysqli::ping()
to automatically reconnect. If you runping()
before any query, the reconnect will happen at that time.