windows server 2008 安裝MySQL 8.0 遇到報錯 1055 - Expression #1 of ORDER BY clause is not in GROUP BY

mysql安裝參考教程:http://www.javashuo.com/article/p-crkbtfbt-et.htmlpython

安裝完畢後mysql

執行sql語句 SELECT * FROM court_info GROUP BY second_court_name HAVING COUNT(second_court_name) > 1 sql

報錯session

[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_bythis

網上有好多教程,都試了一遍,結果發現大部分沒有用。spa

依次執行這三個 sql語句,執行完畢切記   不要重啓MySQL服務。不要重啓MySQL服務。不要重啓MySQL服務。.net

set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

SELECT version(),@@SESSION.sql_mode,@@GLOBAL.sql_mode; 
相關文章
相關標籤/搜索