Skip to content

How to Bring Back GROUP BY in MySQL

If you are suddenly not able to perform GROUP BY statements as you used to after a MySQL/MariaDB version update, then you will have noticed the change forced upon you.

You can re-enable the previous GROUP BY behaviour by editing your /etc/mysql/my.cnf and adding in the following line below the [mysqld] section:

Code language: Bash (bash)

This will allow you to GROUP BY without having to return all those specific columns as well.

Why this happened

It turns out that the original functionality was a trick that we all used to use, and it was removed recently in order to address “incompatibilities”. You can read more about it here:

This is more of a problem of MySQL having implemented the ANSI standard and then deciding to remove it much later

See also  How to add a Lambda Environment Variable in Terraform
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x