Discussion:
How to solve django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server during query')?
prateek gupta
2018-11-14 10:12:06 UTC
Permalink
Hi All,

I am using Django 2.0.6, Python 3.6. For connecting with Mysql 5.7 I am
using mysqlclient 1.3.12.
Using above environment I have created an admin panel for CRUD operations.
When I select a tabel for viewing it's content following error shows-

django.db.utils.OperationalError: (2013, 'Lost connection to MySQL server
during query')

The above error comes only for one table, rest all are working fine.

I tried to set the max_allowed_packet=67108864 in mysql configuration file
and in settings.py I have set the CONN_MAX_AGE=6000 but it is not working.

Have anyone faced the same issue?
Let me know if anyone knows how to solve this.

Thanks,
Prateek
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/26050b0b-164e-41d1-bd25-7a5d5c29f003%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jason
2018-11-14 13:36:12 UTC
Permalink
just checking, but did you restart the mysql server after setting that
max_allowed_packet setting? It won't stick without a restart.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/046dfeea-e16c-4f1f-8268-fad4d099b3d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jason
2018-11-14 13:37:46 UTC
Permalink
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/36a9c760-a39a-43b0-bdb7-3b225737ac57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
prateek gupta
2018-11-15 04:27:52 UTC
Permalink
Thanks Jason!
I have restarted teh server and updated the mysqlclient to 1.3.13 and the
issue got resolved now.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b8f0cc45-418d-4b55-aeed-92f2b114c80d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
prateek gupta
2018-11-15 06:39:03 UTC
Permalink
It is strange again, now I am getting the same error.
Till morning it was working fine but now it is again showing same error.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Krishnasagar Subhedarpage
2018-11-15 06:56:16 UTC
Permalink
Hi Prateek,

Did you check disk info of server instance? What's disk consumption?

Regards,
Krishnasagar Subhedarpage
Post by prateek gupta
It is strange again, now I am getting the same error.
Till morning it was working fine but now it is again showing same error.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAChYJc-kazkgi0km1rfJRP4S%3D9v6Lfv0Wq4pBy12U6EhNu_Scw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
prateek gupta
2018-11-15 09:11:47 UTC
Permalink
Hi,

My all db have 20 gb of size.

On Thursday, November 15, 2018 at 12:27:27 PM UTC+5:30, Krishnasagar
Post by Krishnasagar Subhedarpage
Hi Prateek,
Did you check disk info of server instance? What's disk consumption?
Regards,
Krishnasagar Subhedarpage
Post by prateek gupta
It is strange again, now I am getting the same error.
Till morning it was working fine but now it is again showing same error.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cf5bdd99-6e58-430f-85bd-6df249378f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
vineeth sagar
2018-11-15 09:20:57 UTC
Permalink
Try reducing the connection max age to a lesser value like 3600 maybe?
Post by prateek gupta
Hi,
My all db have 20 gb of size.
On Thursday, November 15, 2018 at 12:27:27 PM UTC+5:30, Krishnasagar
Post by Krishnasagar Subhedarpage
Hi Prateek,
Did you check disk info of server instance? What's disk consumption?
Regards,
Krishnasagar Subhedarpage
Post by prateek gupta
It is strange again, now I am getting the same error.
Till morning it was working fine but now it is again showing same error.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/cf5bdd99-6e58-430f-85bd-6df249378f2c%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/cf5bdd99-6e58-430f-85bd-6df249378f2c%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMMZq8Ou8-Z8D80XLRDO80HpBfyEmPeXEy9E%3DjgF6JnVE5SC6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Krishnasagar Subhedarpage
2018-11-15 09:46:08 UTC
Permalink
Okay. Please check error logs of mysql. Its default
path: /var/log/mysql/error.log
Please look into any error signals for the same table into it. This could
give clue for root cause of issue.

Regards,
Krishnasagar Subhedarpage
Post by prateek gupta
Hi,
My all db have 20 gb of size.
On Thursday, November 15, 2018 at 12:27:27 PM UTC+5:30, Krishnasagar
Post by Krishnasagar Subhedarpage
Hi Prateek,
Did you check disk info of server instance? What's disk consumption?
Regards,
Krishnasagar Subhedarpage
Post by prateek gupta
It is strange again, now I am getting the same error.
Till morning it was working fine but now it is again showing same error.
Post by Jason
also, you might want to update your mysqlclient package. 1.3.12 was
released over a year ago, and 1.3.13 was pushed out late June of this year.
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/9bd1c72a-7c97-49b5-8a37-646e49dbc785%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/cf5bdd99-6e58-430f-85bd-6df249378f2c%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/cf5bdd99-6e58-430f-85bd-6df249378f2c%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAChYJc91DPRP8cqk9bHn6nrK6PA64oo0Zz3kmxuN_AzOMJmdAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...