Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
最近我注意到 mysql 连接超时,增加 wait_timeout 对此有所帮助。然而它仍然会发生。
我们还启用了 mysqli.reconnect 以试图发现问题并允许脚本继续运行。但是,如果由于超时而运行并失败的 SQL 会像我希望的那样在重新连接时自动重新运行,我看不到任何地方。有任何想法吗?
阅读文档,似乎需要使用mysqli::ping()自动重连。如果您ping()在任何查询之前运行,则重新连接将在那时发生。
mysqli::ping()
ping()