解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated

1.切到etc目录下:cd /etc

2.查看内容:cat my.cnf 或 cat my.cnf more解决[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated_第1张图片

可以看到sql_mode的值,这个值是我改过之后的值,没改之前是ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE或者没有sql_mdoe这个变量没有则需要添加即可。

3.修改文件:vi my.cnf

4.保存

    编辑完内容后,按下Esc键,并输入“:wq”,然后回车就可以保存退出。输入则是“q!”不保存退出

5.重启mysql

 [root@iZj6c8r5jfsgx3hwzzmzahZ etc]# systemctl restart mysqld.service 

你可能感兴趣的:(其他)