1. 程式人生 > >mysql報錯Expression #1 of SELECT list is not in GROUP BY clause and contains non

mysql報錯Expression #1 of SELECT list is not in GROUP BY clause and contains non

專案執行得好好的,換了個數據庫伺服器後就報這個錯了
版本原因

記錄解決辦法
//執行語句
set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
;
如果許可權不夠
ERROR 1227 : Access denied; you need (at least one of) the SUPER privilege(s) for this operation

給使用者賦予許可權

update user set Super_priv=‘Y’ where User=‘root’;
flush privileges;

或者用工具到mysql的user表裡改,把對應的使用者改為’Y’ ,然後再flush privileges
在這裡插入圖片描述