Forums

MySql Connection not available

My site was working just fine about 10 minutes ago....all of a sudden, I'm now getting this error...I haven't changed the code at all. What is happening?

File "/usr/local/lib/python3.10/site-packages/mysql/connector/connection_cext.py", line 590, in cursor raise errors.OperationalError("MySQL Connection not available.") mysql.connector.errors.OperationalError: MySQL Connection not available.

Ok..I think I got this fixed by moving the connections to the database closer in the code to where I actually insert a record.

I had the same problem, and simply restarting the web application solved it

Take a look at https://help.pythonanywhere.com/pages/ManagingDatabaseConnections/