mysql报错this is incompatible with sql_mode=only_full_group_by

Posted 落泪秋

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql报错this is incompatible with sql_mode=only_full_group_by相关的知识,希望对你有一定的参考价值。

 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的主要内容,如果未能解决你的问题,请参考以下文章

报错:1130-host ... is not allowed to connect to this MySql server

mysql报错this is incompatible with sql_mode=only_full_group_by

远程连接mysql报错:1130 - Host XXX is not allowed to connect to this MySQL server

报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

报错:1130-host ... is not allowed to connect to this MySql server 开放mysql远程连接 不使用localhost

远程mysql报错GHost ‘xxx‘ is not allowed to connect to this MySQL serverConnection closed by foreign host