Mysql 5.7版本报错 1055

来源:互联网 发布:大数据译见 编辑:程序博客网 时间:2024/06/06 00:05

错误提示:

[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

具体原因我没有去了解,据说是5.7版本中的sql_mode=only_full_group_by,
使用SQL语句查询:
select @@global.sql_mode
可以发现ONLY_FULL_GROUP_BY这个东西的存在,只要把它去掉就行了。
SQL语句:
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
执行这一句就解决问题了。


0 0
原创粉丝点击