Reconnecting MySQL on timeout
问题 I have a Python program which runs on background for weeks, and does database queries every once in a while. For that, I am using the ORM peewee (version 2.2.1). I am using MySQL as a backend. Lately I've encountered a recurring problem with accessing the DB, usually after days of running the program. The error which is raised by peewee is peewee.OperationalError: (2006, 'MySQL server has gone away') The traceback is deep in peewee . I post it here, but as my virtualenv makes filenames too