错误:this is incompatible with sql_mode=only_full_group_by
Posted 山高我为峰
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了错误:this is incompatible with sql_mode=only_full_group_by相关的知识,希望对你有一定的参考价值。
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘H5APP_WORKREPORT.c.id‘ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
原因:
这个错误的原因是高版本mysql(客户服务器版本5..7.18)默认的sql_mode包含ONLY_FULL_GROUP_BY,这个属性保证了select到的列都在group by中出现.
查看SQL_MODE的语句如下:
select @@GLOBAL.sql_mode;
解决方案:
方法一.可以使用SQL语句暂时修改SQL_MODE,重启mysql后就会事项:
set @@GLOBAL.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配置文件,通过手动添加sql_mode的方式强制指定不需要ONLY_FULL_GROUP_BY属性,my.cnf位于etc文件夹下,vim下光标移到最后,
添加如下:
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
以上是关于错误:this is incompatible with sql_mode=only_full_group_by的主要内容,如果未能解决你的问题,请参考以下文章
错误:this is incompatible with sql_mode=only_full_group_by
this is incompatible with sql_mode=only_full_group_by错误解决
Mysql5.7版本sql错误:this is incompatible with sql_mode=only_full_group_by
Mysql5.7版本sql错误:this is incompatible with sql_mode=only_full_group_by
MySQL 出现 this is incompatible with sql_mode=only_full_group_by错误 解决办法
"this is incompatible with sql_mode=only_full_group_by"错误解决方案