Upgrading to MySQL 5.7? Beware of the new STRICT mode !

Started by aegersz, June 26, 2021, 04:00:08 AM

Previous topic - Next topic

aegersz

By default, MySQL 5.7 is much "stricter" than older versions of MySQL and that can make your application fail.

To temporarily fix this, change the SQL_MODE to NO_ENGINE_SUBSTITUTION (same as in MySQL 5.6).

see https://www.percona.com/blog/2016/10/18/upgrading-to-mysql-5-7-beware-of-the-new-strict-mode/ for more details.

I just had a problem with a mod (see errors below) using zero date/time values which took many hours to debug !

Undefined index: database_error in ./Sources/Subs-Db-mysql.php

PHP Fatal error: Call to undefined function allowedTo() in /Sources/Subs-Db-mysql.php on line 1427


The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

albertlast

in smf 2.1 we force mysql to run in strict,
so you should advanced your sql skills to be able to run in this env.

shawnb61

SMF 2.0.x has a setting that allows you to turn off strict mode.

Add the following to your Settings.php:
$mysql_set_mode = true;

This disables all of the various strict mode settings.  You shouldn't have to change any code or data.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: