解决:mysql 5.7.9 [Err] 1055 ...this is incompatible with sql_mode=only_full_group_by

mysql 5.7.9 [Err] 1055 插入时候会报错,错误代码如下

[Err] 1055 - 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_full_group_by

在my.cnf (或者my.ini)里面设置
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

在sql_mode 中去掉only_full_group_by ,解决问题!

作者:笑天涯
链接:https://www.zhihu.com/question/37942423/answer/88964542
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

你可能感兴趣的:(解决:mysql 5.7.9 [Err] 1055 ...this is incompatible with sql_mode=only_full_group_by)