解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains...报错

1 问题

用SET foreign_key_checks = 0;关闭mysql外键约束的时候,出现如下异常:

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause...

2 解决方法

修改mysql配置文件 vim /etc/my.cnf ,修改sql_mode的值,去掉ONLY_FULL_GROUP_BY

sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains...报错_第1张图片

然后重启mysql服务

service mysqld restart

 

你可能感兴趣的:(解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains...报错)