Mysql版本升級到5.7.20版本后惦辛,查詢的時候出現(xiàn)如下報錯:
1055, "Expression #2 of SELECT list is not in GROUP BY
clause and contains nonaggregated column 'xx' which is not functionally dependent on columns in GROUP BY clause;
this is incompatible with sql_mode=only_full_group_by"
解決方式:
用root賬戶登錄:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));