News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

MySQL 5.7 Strict mode

Started by daverj, September 23, 2019, 12:51:37 PM

Previous topic - Next topic

daverj

I have SMF 2.0.15 installed. I currently am running under PHP 5.6.4 and MySQL 5.6

My server's cPanel has been sending me messages saying that I should upgrade to MySQL 5.7. I checked the forums and see that this is OK for SMF 2.0.15. But I also saw a note in a post saying that 2.0.x doesn't support Strict Mode.

When I went to do the MySQL upgrade it warned me that Strict Mode is enabled by default in 5.7

So, is Strict Mode truly not supported in SMF 2.0.15? And if so, how do I disable Strict Mode in MySQL after I upgrade it to 5.7?

Arantor

2.0 definitely has some issues with strict mode, as do various mods. The situation is better in 2.1.

The general recommendation is to turn off strict mode, either by asking the host nicely (or setting sql_mode yourself either in the server or in SMF's code just after the connection is made by querying explicitly to set sql_mode to empty)

sirfpsycho

If you have the root access of your sever then use the below code:

# nano --nowrap /etc/my.cnf

and add below line:

sql_mode="NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Arantor

Where you put it in the file matters though...

daverj

I do have root access. It's a VPS, so I full admin privileges.

Quote from: Arantor on September 24, 2019, 02:35:47 AM
Where you put it in the file matters though...

So.... where in the file should it go?

Arantor

Assuming a normal recent Ubuntu/Debian style install, somewhere under the [mysqld] section.

Advertisement: