MariaDB 10.2 strict mode settings and compatability with the old code

In MariaDB 10.2 and MySQL 5.7 strict mode is enabled by default. Strict mode tells server to reject SQL queries, that does not pass table structure checks, have missing fields and so on. In general – in old days we could write queries, that were missing some fields, some values and server would fix/ignore them. With strict mode enabled – SQL error would be thrown.

In most cases this can cause problems with code, where developers did not pay enough attention to queries and table definitions.

To change this behavior and let old queries run, you need to change sql_mode parameters for MySQL server. Open my.cnf (usually /etc/my.cnf) and either add or change the following parameters:

sql-mode="NO_ENGINE_SUBSTITUTION"

Remember to restart your MySQL server.

Leave a Reply

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