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

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

时间: 2024-10-10 14:24:20

mysql报错this is incompatible with sql_mode=only_full_group_by的相关文章

mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by

在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database_tl.emp.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with s

mysql5.7 gruop by报错this is incompatible with sql_mode=only_full_group_by

解析:在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'database_tl.emp.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible wit

mysql报错: unknown variable 'sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES'

在修改mysql默认字符集的时候: 1. 需要拷贝/usr/share/mysql下的my-huge.cnf 或者my-small.cnf到 /etc/my.cnf,但是官网说:从5.7.18开始不在二进制包中提供my-default.cnf文件. 所以我直接把my-default.cnf作为配置文件 2. 但是因为my-default.cnf最下面的这句 在登录mysql时会报错 3 直接删除掉最下面的sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_T

解决mysql报错:- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ'

mysql执行报错: - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_fu

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ..... this is incompatible with sql_mode=only_full_group_by

一.异常信息 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'daotable.

Mysql 分组查询出现'this is incompatible with sql_mode=only_full_group_by'的解决办法

由于Mysql自动开启了 only_full_group_by,所以若查询的字段不在group by里面,则分组报错. 解决办法其一:mysql配置,关闭only_full_group_by,这种办法自行百度 下面说第二种办法: 除去group_by 以外的参数加上any_value(*) 如:SELECT type_id,any_value(`name`)  FROM ts_product GROUP BY type_id; Mysql 分组查询出现'this is incompatible

Mysql报错 Cannot load from mysql.proc

Auth: Jin Date: 20140716 mysql --default-character-set utf8 -h127.0.0.1 -uroot -p < account-20140716-1.sql ERROR 1548 (HY000) at line 57: Cannot load from mysql.proc. The table is probably corruptedmysql> SHOW PROCEDURE status; ERROR 1548 (HY000): C

MySQL 报错 1055

具体报错 [2019-02-20 11:57:36] [42000][1055] Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'exer.student.sid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode

mysql报错问题解决Character set &#39;utf8mb4&#39; is not a compiled character set

mysql: Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file 报错的解决方法 1.由于日常程序使用了字符集utf8mb4,为了避免每次更新时,set names utf8mb4,就把配置文件改了,如下: 增加了mysql客户端的默认字符集设置 [[email protected]~]# vim