M
M
ManWithBear2015-07-07 03:10:09
MySQL
ManWithBear, 2015-07-07 03:10:09

How to solve the problem of losing connection with the database?

I am writing a small server, using peewee to work with MySQL. Everything is fine, but after a while everything crashes with an error:

peewee.OperationalError: (2006, 'MySQL server has gone away')

Tried wrapping all db calls in
try: 
  msg.save()
except peewee.OperationalError as exc:
  dc.connect() 
  msg.save()

But it did not help.
What can be done and how best to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2015-07-07
@ManWithBear

dev.mysql.com/doc/refman/5.5/en/server-system-vari...
see what the variable is equal to.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question