今天在使用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; this is incompatible with sql_mode=only_full_group_by”这样的错误,以前没有遇见过,现记录一下。
首先是在/etc/my.cnf配置文件的[mysqld] 下添加:
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
然后在MySQL的bin目录下输入service mysqld restart重启MySQL即可。