问题描述
我有一个MySQL已经离开Django在WSGI下。我在stackoverflow中找到了这个问题的条目,但Django没有任何具体的内容。除了解决方法(比如轮询网站一次,或者增加数据库超时),谷歌没有帮助。没有明确的从技术上讲,Django和/或MySQLdb(我使用的是最新的1.2.3c1)如果服务器挂断了连接,应该尝试重新连接,但这不会发生。如何解决这个问题而不用解决方法? 显示变量,如'wait_timeout';
这是这个设置会抛出mysql走了错误_
将其设置为非常大的值,以防止它消失,
或简单重新ping一段时间后的mysql连接
I have a MySQL gone away with Django under WSGI. I found entries for this problem on stackoverflow, but nothing with Django specifically. Google does not help, except for workarounds (like polling the website every once in a while, or increasing the database timeout). Nothing definitive. Technically, Django and/or MySQLdb (I'm using the latest 1.2.3c1) should attempt a reconnect if the server hanged the connection, but this does not happen. How can I solve this issue without workarounds ?
show variables like 'wait_timeout';
this is the setting will throw back the "mysql gone away" error
set it to a very large value to prevent it "gone away"
or simple re-ping the mysql connection after certain period
这篇关于(2006年,“MySQL服务器已经消失”)在WSGI django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!