I accidentally enabled ONLY_FULL_GROUP_BY mode like this:
SET sql_mode = \'ONLY_FULL_GROUP_BY\';
How do I disable it?
The MySQL documentation also specifies the following methods:
sql-mode="" in an option file such as my.cnf (Unix operating systems) or my.ini (Windows).--sql-mode="" option.*Where is a list of different modes separated by commas.
To clear the SQL mode explicitly, set it to an empty string using --sql-mode="" on the command line, or sql-mode="" in an option file.
I added the sql-mode="" option to /etc/my.cnf and it worked.
This SO solution discusses ways to find out which my.cnf file is being used by MySQL.
Don't forget to restart MySQL after making changes.