Home > database >  How to keep mysql 5.6 GROUP BY rules on 8.0?
How to keep mysql 5.6 GROUP BY rules on 8.0?

Time:01-11

With mysql 8.0 the GROUP BY rules got stricter. Is there a way to upgrade to mysql 8.0 without needing to rewrite the queries?

CodePudding user response:

In my.cnf in the section [mysqld] add the following:

sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

And restart MySQL. It will permanently disable the ONLY_FULL_GROUP_BY feature of MySQL 8.x

  •  Tags:  
  • Related