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
Tips for Solving the 2027 Malformed Packet Error in MySQL
When Updating Django from 1.6 to 2.0, django.db.utils.InternalError: (1364, "Field 'name' doesn't have a default value") Occurs During Migration
mysql django.db.utils.InterfaceError: (0, '')
MySQL 5.6: ERROR 1265 (01000): Data truncated for column ... prevents SQL execution
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.