Global sql_mode keeps changing
I have to run this query every week, the server keeps changing by itself.
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.
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.
-
Hello @polle To have this last past a restart to MySQL you should add this into /etc/my.cnf, for example: [mysqld] sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"0 -
Can you please share exactly what I need to add to /etc/my.cnf to have both things permanent? Thank you. 0 -
Open the file /etc/my.cnf add the line sql_mode=
save the file Restart mysql service0
Please sign in to leave a comment.
Comments
3 comments