Is there a possible way to re-establish MySQL connection in Django after it goes down?
I am getting the following error while trying to access MySQL using the get_wsgi_application
in django.core.wsgi
:
(2006,'MYSQL server has gone away')
Is there a possible way to re-establish MySQL connection in Django after it goes down?
I am getting the following error while trying to access MySQL using the get_wsgi_application
in django.core.wsgi
:
(2006,'MYSQL server has gone away')
We need to close the old connection to db, which Django had automatically created before.
We can do this by executing the function:
django.db.close_old_connections()
Django automatically creates new connections after closing previous connections.