mysql报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

Posted xiangyuqi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre相关的知识,希望对你有一定的参考价值。

原因:

  https://blog.csdn.net/fansili/article/details/78664267

解决办法:

  1:查看mysql配置文件位置

[[email protected] ~]# ps -ef | grep mysql
mysql      838     1  0 02:21 ?        00:00:00 /usr/sbin/mysqld --defaults-file=/etc/my.cnf
root      2035  1706  0 02:29 pts/0    00:00:00 grep --color=auto mysql

  2:打开配置文件

[[email protected] ~]# vim /etc/my.cnf

  3:修改配置:如果没有该配置项,添加一个即可

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  4:重启mysql

[[email protected] ~]# systemctl restart mysql

  

以上是关于mysql报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre的主要内容,如果未能解决你的问题,请参考以下文章

windows server 2008 安装MySQL 8.0 遇到报错 1055 - Expression #1 of ORDER BY clause is not in GROUP BY(示例代

MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated col

mysql报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre

mysql:报错Expression #1 of SELECT list is not in GROUP BY clause and contains nonag

mysql报错Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column问题(示例

mysql报错Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column问题(示例