Re: Upgrade Mysql

2014-06-20 Thread Tom Evans
On Fri, Jun 20, 2014 at 5:04 PM, Dariusz Mysior  wrote:
> But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE and
> in don't have in my general directory file my.cnf :/ 

Helpfully, mysql uses my.cnf to refer to a whole raft of different
config files (or rather, multiple config files all called my.cnf get
read, combined in a specific order, and specific sections read
depending on what program is being run). You are saying your app - the
mysql client - does not have a my.cnf. Francois is saying that the
mysql server's my.cnf has that setting.

Even if it doesn't, it will have a default value. If the servers
"default" value differs from your client's "default" value then you
would have the same issue.

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAFHbX1LgnvK54CMBqjqy88toPkMcJgyVp3bySwuZBSBxgpq58Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
But in mysite-mysite-settings.py in DATABASES I dont't have CONN_MAX_AGE 
and in don't have in my general directory file my.cnf :/ 

W dniu piątek, 20 czerwca 2014 17:31:10 UTC+2 użytkownik Dariusz Mysior 
napisał:
>
> 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 "", line 1, in 
>   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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/ac07e598-aa07-4319-b12a-b354b118e61c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade Mysql

2014-06-20 Thread François Schiettecatte
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  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 "", line 1, in 
> 
>   
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> 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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.


Upgrade Mysql

2014-06-20 Thread Dariusz Mysior
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 "", line 1, in 
  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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.