[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
原因分析:
only_full_group_by :使用这个就是使用和oracle一样的group 规则, select的列都要在group中,或者本身是聚合列(SUM,AVG,MAX,MIN) 才行。5.6版本中没有这约束。5.7.21有。去掉就可以了。
解决方式:
linux登录mysql
mysql -uroot -p
输入密码
执行:select version(), @@sql_mode;
在执行:
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
把ONLY_FULL_GROUP_BY去掉。
退出重启mysql服务:
service mysqld restart
问题解决。