2020-03-31
阅读量:
1623
MySQL:1055错误
MySQL:1055错误
(Error Code: 1055. Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'school.b.s_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by)
错误原因:在MySQL5.7之后,sql_mode中默认存在ONLY_FULL_GROUP_BY,SQL语句未通过ONLY_FULL_GROUP_BY语义检查所以报错。
ONLY_FULL_GROUP_BY:ONLY_FULL_GROUP_BY要求select语句中查询出来的列必须是明确的(其他语句也是一样)。
解决办法:
在当前服务中临时解决MySQL8.0 1055错误
执行语句:set sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
(永久解决需要在配置文件中更改,可参考:https://www.cnblogs.com/haoyul/p/9882853.html)






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论