I use a flask and a peewee. Sometimes peewee throws this error
MySQL server has gone away (error(32, 'Broken pipe'))
Connect to the Peewee Database
db = PooledMySQLDatabase(database,**{
"passwd": password, "user": user,
"max_connections":None,"stale_timeout":None,
"threadlocals" : True
})
@app.before_request
def before_request():
db.connect()
@app.teardown_request
def teardown_request(exception):
db.close()
After the mysql error that "the MySQL server is gone (error (32," Broken pipe ")), query selection works without problems, but inserting, updating, deleting queries does not work.
Insertions, updates, query deletions work behind (in mysql), but peewee throws these errors.
(2006, "MySQL server has gone away (error(32, 'Broken pipe'))")
source
share