Mysql执行查询的时候报错,提示:1055 - Expression #1 of ORDER BY clause is not in GROUP BY

提问者:帅平 问题分类:数据库
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
1 个回答
刂阝余己忄已
刂阝余己忄已
这是由于mysql_mode造成的,所以需要在my.cnf下配置sql_mode,示例如下:
[mysqld] sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

然后重启mysql即可。
发布于:3个月前 (02-27) IP属地:未知
我来回答