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 ?
Share
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