SELECT列表的表达式不在GROUP BY子句中,并且包含非聚合列,这与sql_mode = only_full_group_by不兼容

mysql报错:
SELECT list is not in GROUP BY clause and contains nonaggregated column ‘goldencis_voc.t_alarm_history.alarm_time’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
翻译:
SELECT列表的表达式不在GROUP BY子句中,并且包含非聚合列,这与sql_mode = only_full_group_by不兼容

解决办法:
1、找到mysql的配置文件 my.ini (一般在mysql根目录)

2、在my.ini 中将以下内容添加到 [mysqld]下

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

3、重启mysql服务!问题解决!

你可能感兴趣的:(mysql错误)