I removed NO_ENGINE_SUBSTITUTION because I got 'Lost connection to MySQL server during query' in Django
DjangoMySQL
2021-11-14 11:10 (4 years ago)

When issuing a query to MySQL (5.7) using Django
(2013, 'Lost connection to MySQL server during query')
the error appeared and the process stopped.
First, check the innodb_strict_mode with the active connection
SHOW VARIABLES LIKE '%innodb_strict_mode%';
It needs to be ON.
https://django-mysql.readthedocs.io/en/latest/checks.html#django-mysql-w002-innodb-strict-mode
This was already ON.
Next, check the sql_mode.
SELECT @@SESSION.sql_mode;
STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Remove NO_ENGINE_SUBSTITUTION from the MySQL server and restart
STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER
This issue no longer appears
Please rate this article (No signup or login required)
Current rating: 1.0 (1)
Related posts
How to Fix Display Issues in Django Admin Inlines After Upgrading to 5.1
Return Login and Redirect Views by Hardcoding Social Account Provider in django-allauth (When Using AWS Cognito, etc.)
Here's the English translation of your blog title:"A Story About Trying to JOIN Fields with Different Collations in MySQL and Getting 'Range checked for each record'"
After Upgrading to Django 5 and Updating Dependencies, SSL: CERTIFICATE_VERIFY_FAILED Error Occurs When Sending Emails
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.