[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
升級之后,執(zhí)行sql語句减宣,結果報[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 這個錯誤揽思,語句雖然執(zhí)行成功了,但是出現(xiàn)這個錯誤茬贵。
于是百度了一下這個錯誤的解決辦法:
查看下SQL的模式
SHOW VARIABLES LIKE '%sql_mode%';??
的確是存在 ONLY_FULL_GROUP_BY.
修改sql_mode的值:
set sql_mode = '';
set sql_mode = 'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES';
再次執(zhí)行剛才的語句,就OK了移袍。
或者? 解決方案:
select version(),
@@sql_mode;SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
或者??在my.ini中加入如下代碼:
[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
重啟服務即可解藻。