How to resolve MySQL-this is incompatible with sql_mode=only_full_group_by errors
This article mainly explains "how to solve MySQL-this is incompatible with sql_mode=only_full_group_by errors". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to solve MySQL-this is incompatible with sql_mode=only_full_group_by errors".
Because sql is not strictly written, select uses fields that are not available in group by.
Solve the problem by configuring sql_mode
Select @ @ GLOBAL.sql_mode
This error occurs due to problems with mysql version 5.7 and above:
The default sql configuration for mysql version 5.7 is: sql_mode= "ONLY_FULL_GROUP_BY", which strictly adheres to the "SQL92 standard".
When upgrading from 5.6 to 5.7, for syntax compatibility, most of them choose to adjust sql_mode to keep it consistent with 5.6, in order to be compatible with programs as much as possible.
Get rid of ONLY_FULL_GROUP_BY and OK.
Vi / etc/mysql/mysql.conf.d/mysqld.cnf
Sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION, thank you for your reading. The above is the content of "how to solve MySQL-this is incompatible with sql_mode=only_full_group_by errors". After studying this article, I believe that you have a deeper understanding of how to solve the problem of MySQL-this is incompatible with sql_mode=only_full_group_by errors, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!