Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: daverj - syyskuu 23, 2019, 12:51:37 IP

Otsikko: MySQL 5.7 Strict mode
Kirjoitti: daverj - syyskuu 23, 2019, 12:51:37 IP
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?
Otsikko: Re: MySQL 5.7 Strict mode
Kirjoitti: Arantor - syyskuu 23, 2019, 12:56:40 IP
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)
Otsikko: Re: MySQL 5.7 Strict mode
Kirjoitti: sirfpsycho - syyskuu 24, 2019, 01:06:40 AP
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"
Otsikko: Re: MySQL 5.7 Strict mode
Kirjoitti: Arantor - syyskuu 24, 2019, 02:35:47 AP
Where you put it in the file matters though...
Otsikko: Re: MySQL 5.7 Strict mode
Kirjoitti: daverj - syyskuu 24, 2019, 05:48:40 IP
I do have root access. It's a VPS, so I full admin privileges.

Lainaus käyttäjältä: Arantor - syyskuu 24, 2019, 02:35:47 AP
Where you put it in the file matters though...

So.... where in the file should it go?
Otsikko: Re: MySQL 5.7 Strict mode
Kirjoitti: Arantor - syyskuu 24, 2019, 06:00:29 IP
Assuming a normal recent Ubuntu/Debian style install, somewhere under the [mysqld] section.