MYSQL5.7版本sql_mode=only_full_group_by问题

某天在做数据迁移的时候,迁移到新的数据库后,返现应用报错。查看log后,发现报如下错误:

which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

查阅后发现sql_mode=only_full_group_by是关键
解决方法如下:
直接到/etc目录下,修改my.cnf
添加如下内容:

# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
image.png

重启mysql

systemctl restart mysqld

你可能感兴趣的:(MYSQL5.7版本sql_mode=only_full_group_by问题)