MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause

Posted 51python

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause相关的知识,希望对你有一定的参考价值。

方案1:

修改sql_mode的值

set sql_mode = ‘‘;
set sql_mode = ‘NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES‘;

再次执行刚才的语句,就不会报错了。

方案2:

在my.cnf添加如下:

[mysqld]

sql_mode=NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES

如果没有my.cnf,有my.ini.txt也行。

 

 

参考:

https://www.cnblogs.com/skymyyang/p/7551646.html

https://blog.csdn.net/huihuikuaipao_/article/details/84106480

以上是关于MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause的主要内容,如果未能解决你的问题,请参考以下文章

mysql 5.7.9 [Err] 1055 插入时候会报错

mysql 5.7.9 [Err] 1055 插入时候会报错

[err] 1055

MySQL-[Err] 1055 - Expression #1

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL