Error OperationalError: (OperationalError) (2006, \'MySQL server has gone away\')
i\'m already received this error when i coded project on Flask, but i cant underst
I just faced the same problem, which is solved with some effort. Wish my experience be helpful to others.
Fallowing some suggestions, I used connection pool and set pool_recycle
less than wait_timeout
, but it still doesn't work.
Then, I realized that global session maybe just use the same connection and connection pool didn't work. To avoid global session, for each request generate a new session which is removed by Session.remove()
after processing.
Finally, all is well.