遇到了异常:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'a.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by解决方法
1,运行命令
SET GLOBAL sql_mode='';
2,设置mysql的配置文件,在/etc/my.cnf里
ps:这个设置是mysql5.7.5版本之后默认加入的,在mysql5.7.11里show global variables like "sql_mode",得到如下的结果:
(这个系统显示貌似有点问题)
解决MySQL only_full_group_by 错误
本文介绍了解决MySQL中因only_full_group_by设置而导致的错误的方法。通过修改MySQL配置文件或使用SET GLOBAL命令可以暂时或永久禁用该选项。
3775

被折叠的 条评论
为什么被折叠?



