mysql使用group by 异常on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

临时解决

SET @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

 

重新后还会出现

修改MySQL配置文件

Linux下my.cnf或Windows下My.ini

注意在[mysqld]段下添加以下代码:

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

 

 

posted @ 2023-04-21 10:10  韦邦杠  阅读(98)  评论(0编辑  收藏  举报