0

As we know, mysql server will close idle connection exceed wait_timeout time, for the reason, my app based django always arise errors:

operationalerror (2006 'mysql server has gone away') django

I remember that we can config client connections with auto reconnect in the java:

jdbc.url=jdbc:mysql://localhost:3306/oa?useUnicode=true&characterEncoding=utf-8&mysqlEncoding=utf8&autoReconnect=true

can anyone tell me how can i config the params in django ,thanks

hongfuLi
  • 46
  • 4
  • I'm not sure how that would turn out. Your code might be in the middle of a transaction when the connection is lost; or it might be in the middle of iterating over result rows. How do you envision Django recreating those transaction and cursor states automatically? – lanzz Feb 25 '14 at 16:21
  • My problem look like the [post](http://stackoverflow.com/questions/14163429/python-and-django-operationalerror-2006-mysql-server-has-gone-away), that post mentioned to use 'ping()' to check and reconnect the stale connection. but i prefer configing a global param like jdbc param to inserting 'ping()' code in every db operation. sorry for my poor english, i am not sure you can understand my poor english – hongfuLi Feb 26 '14 at 01:32

0 Answers0