#31887 closed Uncategorized (invalid)
OperationalError: (2006, 'MySQL server has gone away')
Reported by: | Mirian Pardo | Owned by: | Mirian Pardo |
---|---|---|---|
Component: | Error reporting | Version: | 3.1 |
Severity: | Normal | Keywords: | uso de Max y Min |
Cc: | Mirian Pardo | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Change History (3)
comment:1 by , 4 years ago
Cc: | added |
---|---|
Component: | Uncategorized → Error reporting |
Description: | modified (diff) |
Owner: | changed from | to
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Version 0, edited 4 years ago by (next)
comment:2 by , 4 years ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Triage Stage: | Accepted → Unreviewed |
Please don't use Trac as a support channel. Closing per TicketClosingReasons/UseSupportChannels.
Also please don't accept your own tickets.
comment:3 by , 4 years ago
Summary: | from django.db.models import Avg, Max, Min, Sum In [369]: from StoreWeb.models import Product, Price In [370]: Price.objects.all().aggregate(Min('value')) → OperationalError: (2006, 'MySQL server has gone away') |
---|
Note:
See TracTickets
for help on using tickets.
Hola, compañeros tengo este error al ejecutar las siguientes lines en el shell de django
from django.db.models import Avg, Max, Min, Sum
In [369]: from StoreWeb.models import Product, Price
In [370]: Price.objects.all().aggregate(Min('value'))
EROOR
OperationalError Traceback (most recent call last)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in _execute(self, sql, params, *ignored_wrapper_args)
---> 86 return self.cursor.execute(sql, params)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/mysql/base.py in execute(self, query, args)
---> 74 return self.cursor.execute(query, args)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/cursors.py in execute(self, query, args)
--> 206 res = self._query(query)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/cursors.py in _query(self, q)
--> 319 db.query(q)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/connections.py in query(self, query)
--> 259 _mysql.connection.query(self, query)
OperationalError: (2006, 'MySQL server has gone away')
The above exception was the direct cause of the following exception:
OperationalError Traceback (most recent call last)
<ipython-input-367-52af1526b6a5> in <module>
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/models/query.py in aggregate(self, *args, kwargs)
--> 384 return query.get_aggregation(self.db, kwargs)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/models/sql/query.py in get_aggregation(self, using, added_aggregate_names)
--> 503 result = compiler.execute_sql(SINGLE)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/models/sql/compiler.py in execute_sql(self, result_type, chunked_fetch, chunk_size)
-> 1152 cursor.execute(sql, params)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in execute(self, sql, params)
--> 100 return super().execute(sql, params)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in execute(self, sql, params)
---> 68 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in _execute_with_wrappers(self, sql, params, many, executor)
---> 77 return executor(sql, params, many, context)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in _execute(self, sql, params, *ignored_wrapper_args)
---> 86 return self.cursor.execute(sql, params)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/utils.py in exit(self, exc_type, exc_value, traceback)
---> 90 raise dj_exc_value.with_traceback(traceback) from exc_value
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/utils.py in _execute(self, sql, params, *ignored_wrapper_args)
---> 86 return self.cursor.execute(sql, params)
~/env38/StoreVirtual/lib/python3.8/site-packages/django/db/backends/mysql/base.py in execute(self, query, args)
---> 74 return self.cursor.execute(query, args)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/cursors.py in execute(self, query, args)
--> 206 res = self._query(query)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/cursors.py in _query(self, q)
--> 319 db.query(q)
~/env38/StoreVirtual/lib/python3.8/site-packages/MySQLdb/connections.py in query(self, query)
--> 259 _mysql.connection.query(self, query)
OperationalError: (2006, 'MySQL server has gone away')