问题描述
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
1、 解决办法: 把 sql_mode中的 only_full_group_by 去掉即可。
2、 办法一 (只在当前查询页面有效,不能一次性解决问题!):
select version(), @@sql_mode;SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
3、方法二
添加配置文件(如果没有的话) /etc/mysql/my.cnf
原来这里用的是缺省配置,也就是默认配置,
我们手动添加一个my.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'
