mysql: Syntax error or access violation: 1055 Expression #2 of SELECT (错误解决办法)

2021/8/13 19:36:11

本文主要是介绍mysql: Syntax error or access violation: 1055 Expression #2 of SELECT (错误解决办法),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'seo.ryc_combo_class_cate_list_113.fid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

  

SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'seo.ryc_combo_class_cate_list_113.fid' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

 

 

 

错误原因:

这个错误发生在mysql 5.7 版本及以上版本会出现的问题,在mysql5.7版本默认的sql配置是:sql_mode="ONLY_FULL_GROUP_BY",这个配置严格执行了"SQL92标准",很多从5.6升级到5.7时,为了语法兼容,大部分都会选择调整sql_mode,使其保持跟5.6一致,为了尽量兼容程序

解决方法:

找到数据库配置文件windows中my.ini文件或linux中的my.cnf文件,在mysqld中增加sql_mode=

修改之后重新启动mysql即可

[mysqld]
sql_mode=

  

 



这篇关于mysql: Syntax error or access violation: 1055 Expression #2 of SELECT (错误解决办法)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程