I've got a Django application running on Apache with wsgi module. After couple of hrs of lack of exercise I recieve that error and I must restart the Apache.

Any ideas?


This error message imply that the database server has closed the bond for you. I suppose this really is triggered since the connection is idle.

In my opinion you will get this fixed by modifying waiting for_timeout within the configuration file of the mysql database server. The file is most generally named "my.cnf".

This, however, isn't regarded as a sensible practice. I must suggest you to definitely optimize the applying you're writing to spread out the bond to mysql when needed - there is no indicate ensure that it stays open if you're not positively utilizing it for any very long time.

Should you prefer a fast solution, make use of the mysql_ping() function to check on if the connection continues to be alive and re-open if required.