本文主要是介绍mysql group by报错 with sql_mode=only_full_group_by,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误内容
SQL 错误 [1055] [42000]: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'xx.xx.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
修改
@ubuntu-server:/$ sudo vim /etc/mysql/conf.d/mysql.cnf
@ubuntu-server:/$ sudo systemctl stop mysql
@ubuntu-server:/$ sudo systemctl start mysql
@ubuntu-server:/$
# The MySQL Client configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html[mysql][mysqld]
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"weijianwei@ubuntu-server:/$
这篇关于mysql group by报错 with sql_mode=only_full_group_by的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!