mysql5.7 1055

错误提示:

[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语句查询:SHOW VARIABLES LIKE '%sql_mode%

可以发现ONLY_FULL_GROUP_BY这个东西的存在,只要把它去掉就行了。
SQL语句:
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
执行这一句就解决问题了。

猜你喜欢

转载自www.cnblogs.com/liushuchen/p/9934215.html