I accidentally enabled ONLY_FULL_GROUP_BY mode like this:
SET sql_mode = \'ONLY_FULL_GROUP_BY\';
How do I disable it?
Adding only one mode to sql_mode without removing existing ones:
SET sql_mode=(SELECT CONCAT(@@sql_mode,','));
Removing only a specific mode from sql_mode without removing others:
SET sql_mode=(SELECT REPLACE(@@sql_mode,'',''));
In your case, if you want to remove only ONLY_FULL_GROUP_BY
mode, then use below command:
SET sql_mode=(SELECT REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''));
Reference: http://johnemb.blogspot.com/2014/09/adding-or-removing-individual-sql-modes.html