sql語句報錯:SELECT list is not in GROUP BY clause and contains nonaggregated
環境是ubuntu,mysql版本5.7.27,在/etc/mysql/mysql.conf.d/mysqld.cnf
找到圖中的代碼
並添加 sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
添加以後:
然後重啓mysql sudo systemctl restart mysql.service