mysql 5.7之后 报错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and ...

具体错误是:

[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; this is incompatible with sql_mode=only_full_group_by

centos linux处理办法:

进入 /etc,sudo vim 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_ENGINE_SUBSTITUTION,如果没有sql_mode则添加sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

保存并退出my.cnf,然后关闭mysql --》sudo service mysqld stop 然后重启 sudo service mysqld start,ok!

你可能感兴趣的:(mysql,linux)