which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mo
问题描述
mysql 查询得时候,出现以上异常
问题分析
以上问题是因为mysql版本不同引起得,而且是,你目前用得mysql版本高于之前得
这里是因为我接手之前项目使用得是mysql5.6版本得,而我部署得却是5.7版本!
bug解决
在my.cnf配置中加上一下,linux 使用 vim /etc/my.cnf
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION