[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' mysql 創(chuàng)建表是出現 [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 原因 在MySQL5.7之后,sql_mode中默認存在ONLY_FULL_GROUP_BY,SQL語句未通過ONLY_FULL_GROUP_BY語義檢查所以報錯。 ONLY_FULL_GROUP_BY要求select語句中查詢出來的列必須是明確的 解決方案 登錄msyql SELECT @@sql_mode 查詢結果 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 修改my.conf 新增sql_mode,去掉 ONLY_FULL_GROUP_BY 修改內容如下 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 重啟即可 轉載請注明出處 |
|