sql语句报错:SELECT list is not in GROUP BY clause and contains nonaggregated

环境是ubuntu,mysql版本5.7.27,在/etc/mysql/mysql.conf.d/mysqld.cnf
找到图中的代码

clipboard.png
并添加 sql_mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
添加以后:

clipboard.png

然后重启mysql sudo systemctl restart mysql.service


skystars
67 声望2 粉丝