mysql Ver 14.14 Distrib 5.7.38, for Linux (x86_64) using EditLine wrapper
Distributor ID: Ubuntu Description: Ubuntu 18.04.5 LTS Release: 18.04 Codename: bionic
MYSQL Keeps reseting my sql_mode and so my website is not working well.
The MySQL message is the following
Expression #18 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'testdevnew.f.created_at' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
What I do till now is from terminal to connect inside mysql with the command
mysql -u root -p
and run the following commands
mysql> set global sql_mode='NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; mysql> set session sql_mode='NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
And the error is gone, but for a couple of days… lets say that we restart mysql server and the above settings are gone.
Also tried to change the following files with the sql_mode that i would like to load after mysql restart.
(I’ve also tried with value in quotes)
Then restart mysql
sudo service mysql restart
But the setting is not affecting mysql restart and I keep getting the error mentioned above.
mysqld --verbose --help
prints the following
Any ideas of what am I doing wrong?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!