Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

安装了mysql5.7.19后,执行语句中只要含有group by 就会报这个错

 

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

 

网上百度了解决方案大致两种方案,但是没有解决这个问题。

第一种方案是修改my.cnf文件,但是我的数据库安装目录里根本没有这个文件;第二种方案是修改sql_mode,但这不能根本上解决这个问题,重启mysql服务后这个问题又会重复出现。

我的系统是mac,参照第一种方案,修改安装目录里my.ini文件,在[mysqld]后面追加下面这句配置后重启服务解决问题。

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

posted @ 2019-03-25 21:01  small_lei_it  阅读(313)  评论(0编辑  收藏  举报