Dariusz 

Not sure about upgrading mysql, what the error is telling you is that mysql is 
dropping the connection before django is done with it.

I would look at CONN_MAX_AGE in DATABASES (in settings.py) and wait_timeout in 
my.cnf, the first should be lower than the second.

For example I have these settings for a project:

        'CONN_MAX_AGE': 3500,                   # 3500 seconds because 
wait_timeout = 3600 in my.cnf


Cheers

François

On Jun 20, 2014, at 11:31 AM, Dariusz Mysior <[email protected]> wrote:

> I use pythonanywhere.com Django 1.6 and Python 2.7 I 
> 
> and when I write p.save() I had error like below.
> It says something about updating mysql to fix it, but I don't know what code 
> or shell commands I need to write.
> 
> Can you help me? One person post that he upgrade MySQL to 5.0.27 but I don't 
> know what is a commend for do this :/.....
> 
> Traceback (most recent call last):
> 
>   
> File "<console>", line 1, in <module>
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py",
>  line 545, in save
> 
>     force_update
> =force_update, update_fields=update_fields)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/models/base.py",
>  line 570, in
>  save_base
>     
> with transaction.commit_on_success_unless_managed(using=using, 
> savepoint=False):
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/transaction.py",
>  line 280, in
>  __enter__
>     connection
> .set_autocommit(False)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/__init__.py",
>  line 340, in
>  set_autocommit
>     self
> ._set_autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
>  line 461, in
>  _set_autocommit
>     self
> .connection.autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/utils.py",
>  line 99, in
>  __exit__
>     six
> .reraise(dj_exc_type, dj_exc_value, traceback)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py",
>  line 461, in
>  _set_autocommit
>     self
> .connection.autocommit(autocommit)
> 
>   
> File 
> "/home/daro822/.virtualenvs/django16/local/lib/python2.7/site-packages/MySQLdb/connections.py",
>  line 243, in
>  autocommit
>     _mysql
> .connection.autocommit(self, on)
> 
> OperationalError
> : (2006, 'MySQL server has gone away')
> 
> 
> -- 
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/0dc3a793-2fd0-4884-87f3-b14724bdd1ab%40googlegroups.com.
> 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ED0A86A-0299-49CE-B959-929EE13EB761%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to