0
点赞
收藏
分享

微信扫一扫

[Linux 完美解决]Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column

[Linux 完美解决]Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column

错误

Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column

一、找到关于mysql的my.cnf文件

不清楚的可以使用 find / -name my.cnf查看文件路径

[root@localhost /]#  find / -name my.cnf
/etc/my.cnf

二、在my.cnf的[mysqld] 下面添加一行数据

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
效果图

三、一定要重启sql服务,要不然还是会没效果

使用/etc/init.d/mysqld restart

[root@localhost etc]# /etc/init.d/mysqld restart
Shutting down MySQL.... SUCCESS! 
Starting MySQL. SUCCESS! 

参考文档

临时解决方法,重启失效: Mysql解决SELECT list is not in GROUP BY clause and contains nonaggregated column 问题

另一个: mysql遇见Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的问题.

mysql重启指令: linux下开启、关闭、重启mysql服务命令

举报

相关推荐

0 条评论