Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #7 of SELECT list contains nonaggregated column 'xxx.bp.end_time'; this is incompatible with sql_mode=only_full_group_by
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #7 of SELECT list contains nonaggregated column 'xxx.bp.end_time'; this is incompatible with sql_mode=only_full_group_by
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #7 of SELECT list contains nonaggregated column 'xxx.bp.end_time'; this is incompatible with sql_mode=only_full_group_by
出现这个原因是我再linux服务器重装mysql5.7.21里面没有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我放到[mysql_safe]下面去了
解决方法:
我把
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]和[mysqld]下面下。