which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mod...

项目中基础sql没按照严格模式,查询的列(无聚合函数等)没有添加在GROUP BY 后面,导致语法报错,

设置自己本地mysql的sql_mode,去掉ONLY_FULL_GROUP_BY。

查询:

SELECT @@sql_mode;

设置全局sql_mode,需要用root用户设置,如下:

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)