I accidentally enabled ONLY_FULL_GROUP_BY mode like this:
SET sql_mode = \'ONLY_FULL_GROUP_BY\';
How do I disable it?
Give this a try:
SET sql_mode = ''
Community Note: As pointed out in the answers below, this actually clears all the SQL modes currently enabled. That may not necessarily be what you want.