某天在做数据迁移的时候,迁移到新的数据库后,返现应用报错。查看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
网友评论