2017-07-05 68 views
0

,我們所得到的問題是:我們已經運行manage.py makemigrations和manage.py成功遷移,之後我們開始得到下面的錯誤:MySQL的惡意數據包錯誤後運行makemigrations Django的

File "/usr/local/goibibo/python/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 110, in execute 
    return self.cursor.execute(query, args) 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/cursors.py", line 250, in execute 
    self.errorhandler(self, exc, value) 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler 
    raise errorvalue 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/cursors.py", line 247, in execute 
    res = self._query(query) 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/cursors.py", line 411, in _query 
    rowcount = self._do_query(q) 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/cursors.py", line 374, in _do_query 
    db.query(q) 
    File "/usr/local/goibibo/python/lib/python3.5/site-packages/MySQLdb/connections.py", line 292, in query 
    _mysql.connection.query(self, query) 
django.db.utils.OperationalError: (2027, 'Malformed packet') 

這問題不會在我們每次運行makemigrations時出現。
它隨機出現,但一旦出現,它就會粘住,我們不知道爲什麼會發生這種情況。 有人可以幫助我們解決這個問題並解釋爲什麼會發生這種情況。

用於應用程序軟件包:

adium-theme-ubuntu==0.3.4 
appdirs==1.4.3 
asn1crypto==0.22.0 
backports-abc==0.5 
blinker==1.4 
boto3==1.4.4 
botocore==1.5.35 
certifi==2017.4.17 
cffi==1.10.0 
chardet==2.3.0 
click==6.7 
ConcurrentLogHandler==0.9.1 
configobj==5.0.6 
decorator==4.0.11 
Django==1.10.4 
djangorestframework==3.5.3 
docutils==0.13.1 
Flask==0.11.1 
futures==3.1.1 
gevent==1.2a1 
greenlet==0.4.10 
gyp==0.1 
idna==2.5 
itsdangerous==0.24 
Jinja2==2.8 
jmespath==0.9.2 
jsonpatch==1.10 
jsonpath==0.75 
jsonpath-rw==1.4.0 
jsonpointer==1.10 
MarkupSafe==1.0 
newrelic==2.82.0.62 
oauthlib==1.0.3 
packaging==16.8 
Pillow==3.1.2 
ply==3.10 
prettytable==0.7.2 
pyasn1==0.1.9 
pycparser==2.17 
pycurl==7.43.0 
PyJWT==1.3.0 
PyMySQL==0.7.9 
PyOpenGL==3.0.2 
pyparsing==2.2.0 
Pyrex==0.9.8.5 
pyserial==3.0.1 
PySocks==1.6.5 
python-dateutil==2.6.0 
PyYAML==3.11 
requests==2.14.2 
s3transfer==0.1.10 
singledispatch==3.4.0.3 
six==1.10.0 
SQLAlchemy==1.1.4 
ssh-import-id==5.5 
tornado==4.4.2 
unity-lens-photos==1.0 
urllib3==1.19.1 
virtualenv==15.1.0 
Werkzeug==0.12.1 
+0

用'pip'嘗試'mysqlcllient'或'MySQLdb'。然後再試一次。 – cutteeth

回答

0

解決由SET read_rnd_buffer_size = 256000爲會話MySQL的5.6.17。不必更改my.ini(cfg)。