Global sql_mode keeps changing

polle

Registered
Feb 12, 2017
2
0
1
Spain
cPanel Access Level
Root Administrator
I have to run this query every week, the server keeps changing by itself.

Code:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'STRICT_TRANS_TABLES',''));
I see this when I go to some of that sites and are not working. So noticing this because my sites are down it is not good and of course having the sites down for who knows how many hours or days until I load specific pages, is worse.

What can the problem be?

Thank you.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
Hello @polle

To have this last past a restart to MySQL you should add this into /etc/my.cnf, for example:

Code:
[mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"
 

lordmwesh

Member
Jun 2, 2007
6
1
151
Nairobi
Open the file /etc/my.cnf

add the line

Code:
sql_mode=
save the file

Restart mysql service
 
  • Like
Reactions: cPanelLauren