Fix SQL Error: GROUP BY incompatible with sql_mode=only_full_group_by

MySQL 5.7.5+ changed the GROUP BY behavior. So in this and future versions GROUP BY would not work in same way as it used to be before.

So to make GROUP BY feature working like before follow these details:

Note: First of all to follow these steps you must need to have root access to your server.

If you want to disable error sql_mode=only_full_group_by  permanently then do those steps:

  1. sudo nano /etc/mysql/my.cnf
  2. Add this to the end of the file
  3. sudo service mysql restart  to restart MySQL

This will disable ONLY_FULL_GROUP_BY for ALL users

About admin

Check Also

Best resources to learn Laravel

Leave a Reply

Your email address will not be published. Required fields are marked *