mysql 1055的解决方案

来源:互联网 发布:sketch up mac vary 编辑:程序博客网 时间:2024/06/06 00:21

我自己用的MySQL版本为5.7.11,同事用的5.6版本,代码从远程服务器上拉下来后运行,mybatis查询时报错,mysql 提示:

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column '字段名' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解决办法下my.ini中将sql_mode 更改为

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

然后重启MySQL Server即可。
原创粉丝点击