[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)建表是出現(xiàn) [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中默認(rèn)存在ONLY_FULL_GROUP_BY,SQL語(yǔ)句未通過(guò)ONLY_FULL_GROUP_BY語(yǔ)義檢查所以報(bào)錯(cuò)。 ONLY_FULL_GROUP_BY要求select語(yǔ)句中查詢出來(lái)的列必須是明確的 解決方案 登錄msyql SELECT @@sql_mode 查詢結(jié)果 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 修改內(nèi)容如下 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION 重啟即可 轉(zhuǎn)載請(qǐng)注明出處 |
|