Description of sql_mode in each version of Mysql
version difference
MySQL 5.5: empty
MySQL 5.6: NO_ENGINE_SUBSTITUTION
MySQL 5.7: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION
MySQL 8.0: ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_ENGINE_SUBSTITUTION
ONLY_FULL_GROUP_BY
For the GROUP BY aggregation operation, if the column in the SELECT does not appear in the GROUP BY, then this SQL is illegal because the column is not in the GROUP BY clause
STRICT_TRANS_TABLES
This option takes effect for transactional storage engines and is invalid for non-transactional storage engines. This option indicates that the strict sql mode is enabled. In the strict sql mode, in the INSERT or UPDATE statement, if a field value that does not meet the requirements is inserted or updated, an error will be reported directly to interrupt the operation
NO_ZERO_IN_DATE
The time field value inserted in MySQL does not allow the date and month to be zero
NO_ZERO_DATE
The value of the time field inserted in MySQL, the date is not allowed to be zero
ERROR_FOR_DIVISION_BY_ZERO
In the INSERT or UPDATE statement, if the data is divided by 0, a warning (in non-strict sql mode) or an error (in strict sql mode) will appear.
When this option is off, numbers are divided by 0, resulting in NULL without warning
When this option is enabled and in non-strict sql mode, the number is divided by 0, and NULL is obtained but a warning is generated
When this option is enabled and in strict sql mode, the number is divided by 0, an error occurs and the operation is interrupted
NO_AUTO_CREATE_USER
In the previous version, the GRANT syntax was used. If the user does not exist, the user will be created automatically. This option restricts this function
NO_ENGINE_SUBSTITUTION
When using the CREATE TABLE or ALTER TABLE syntax to execute the storage engine, if the set storage engine is disabled or not compiled, an error will occur.