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配置文件位置

[root@localhost ~]# 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:打开配置文件

[root@localhost ~]# 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

[root@localhost ~]# systemctl restart mysql

  

上一篇:使用极光推送(www.jpush.cn)向安卓手机推送消息【服务端向客户端主送推送】C#语言


下一篇:Mysql:set password