1. 程式人生 > >mysql 5.7.23 [Err] 1055

mysql 5.7.23 [Err] 1055

執行SQL建表,報出如下錯誤,但是表仍然建立成功。查詢資料原因說明是sql-mode校驗問題。

[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

解決方案:需要在配置檔案中修改。

Linux:/etc/my.cnf (原文連結:http://blog.csdn.net/newb921/article/details/5178011

windows:my.ini

修改sql_mode屬性,如果沒有該屬性,新增一下就好,去掉only_full_group_by。

 

然後重啟資料庫。SHOW VARIABLES LIKE '%sql_mode%';  檢視下SQL的模式看看是否生效。