MySQL 5.7 – sql_mode

MySQL – setting the mode

If your application suddenly dies after updating MySQL, it is always worth checking what the sql_mode was in the previous settings:

SHOW VARIABLES like '%sql_mode%';

and set it again:

SET @@sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; 
SET @@GLOBAL.sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

Or any other mods you need: https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html

5/5 - (1 vote)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top