码迷,mamicode.com
首页 > 数据库 > 详细

mysql报错this is incompatible with sql_mode=only_full_group_by

时间:2018-12-21 22:53:19      阅读:5454      评论:0      收藏:0      [点我收藏+]

标签:ati   ice   alt   tran   style   tar   erro   exce   reg   

 1、报错信息

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column ‘d.total_rated_power_transformer‘; this is incompatible with sql_mode=only_full_group_by

技术分享图片

 

2、修改配置文件

 (1)找到配置文件my.cfg

 find / -name "my.cnf"

技术分享图片

 (2)修改配置文件

 vi /etc/my.cnf
加一行
sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
如果原本有sql_mode,去掉ONLY_FULL_GROUP_BY

 

技术分享图片

3、重启mysql使配置生效

service mysqld restart

技术分享图片

 

mysql报错this is incompatible with sql_mode=only_full_group_by

标签:ati   ice   alt   tran   style   tar   erro   exce   reg   

原文地址:https://www.cnblogs.com/yybrhr/p/10158911.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!