user2659205
user2659205

Reputation: 157

Django OperationalError(2013, "Lost connection to MySQL server during query")

I've been getting the above error when using two servers to connect to the same Aurora DB.

We're running a simple Django REST Framework on Elastic Beanstalk which connects to an Aurora DB cluster. Whenever we start up the DB and test the API from the EBS server connections go through fine. However, if I then start up my local development server connecting to the same DB, I get the operational error when going to the same route on the local server.

In addition if I open the Django shell and run a simple query with the models, the Beanstalk server will then start throwing InterfaceError(0, ''). Again this remains until the Aurora DB is rebooted.

I've dug through a number of sources but haven't found a fix yet. Anyone else have some ideas?

Version Info

Upvotes: 4

Views: 1052

Answers (1)

Paulo Henrique
Paulo Henrique

Reputation: 111

You can try use the MySQL connector PyMySQL==0.7.9

Upvotes: 1

Related Questions