I sometimes get the following error in Django that disappears when the page reloads, I don’t know how to reproduce it. I tried to set wait_timeout to 12 hours in my.cnf, but the error appeared again on mysqld restart, although it was not when I restarted mysqld again, very strange to me.
Traceback (most recent call last):
File ".../python3.4/site-packages/django/db/backends/__init__.py", line 131, in _cursor
return self.create_cursor()
File ".../python3.4/site-packages/mysql/connector/django/base.py", line 536, in create_cursor
cursor = self.connection.cursor()
File ".../python3.4/site-packages/mysql/connector/connection.py", line 1231, in cursor
raise errors.OperationalError("MySQL Connection not available.")
mysql.connector.errors.OperationalError: MySQL Connection not available.
source
share