今天在Ubuntu下的部署项目,发现一些好好的列表页面发生

1055:Expression #11 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'ppm_c.ppm_flow_starting_dealing.status' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 

查了下问题出现的原因:

MySQL 5.7.5及以上功能依赖检测功能。

如果启用了ONLY_FULL_GROUP_BY SQL模式(默认情况下),MySQL将拒绝选择列表,HAVING条件或ORDER BY列表的查询引用在GROUP BY子句中既未命名的非集合列,也不在功能上依赖于它们。

(5.7.5之前,MySQL没有检测到功能依赖关系,默认情况下不启用ONLY_FULL_GROUP_BY。有关5.7.5之前的行为的说明,请参见“MySQL 5.6参考手册”。)
解决方法:

1.临时修改

查询

select @@global.sql_mode

重新设置值

set @@global.sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

这种方式mysql服务重启后就失效了

2.永久解决

修改配置文件

我的配置文件是/etc/mysql/mysql.conf.d/mysqld.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  

重启mysql

问题解决

mysql问题解决SELECT list is not in GROUP BY clause and contains nonaggregated column的更多相关文章

  1. mysql出现“SELECT list is not in GROUP BY clause and contains nonaggregated column [duplicate]”错误提示

    项目跨平台时由于mysql设置的问题,原代码运行出现这个错误,此时把mysql设置改下就好了 sql_mode='NO_ENGINE_SUBSTITUTION'

  2. mysql 8.0下的SELECT list is not in GROUP BY clause and contains nonaggregated column

    mysql的版本 mysql> select version();+-----------+| version() |+-----------+| 8.0.12 |+-----------+ 在 ...

  3. [mysql] Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'loser.tank_admin.login_ip' which is not functionally dependent on columns in GROUP BY clause; this is

    执行SQL: SELECT login_name,login_ip,sex FROM tank_admin GROUP BY login_name ; 时抛出异常. Expression #2 of ...

  4. 【mybatis】【mysql】mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column

    mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains no ...

  5. Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'blog.t_blog.addTime' which is not functi

    sql报错: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT ...

  6. 记录一次mysql由5.6升级到5.7出现的异常---Expression #23 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'c.commentCount' which is not functionally dependent on columns in GROUP BY clause;

    ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expre ...

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

    1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rpa ...

  8. mysql升级后出现Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'userinfo.

    安装了mysql5.7,用group by 查询时抛出如下异常: Expression #3 of SELECT list is not in GROUP BY clause and contains ...

  9. SELECT list is not in GROUP BY clause and contains nonaggregated column

    报错如下: Expression # of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.m ...

随机推荐

  1. [POJ3197]Stall Reservations (贪心)

    题意 (来自洛谷) 约翰的N(l<N< 50000)头奶牛实在是太难伺候了,她们甚至有自己独特的产奶时段.当 然对于某一头奶牛,她每天的产奶时段是固定的,为时间段A到B包括时间段A和时间段 ...

  2. 解压文件出错解决方法(invalid compressed data--format violated)

    解压缩出现这个报错: 1.考虑是否传输过程出错,重新传输试试. 2.使用传输工具时,选择二进制试试. 3.使用传输工具时,选择ASCII试试. 解压缩命令: gzip  -d filename gun ...

  3. linux命令之free篇

    作业二: 1.free命令查看内存 [root@localhost 桌面]# free total used free shared buffers cachedMem: 1003432 899760 ...

  4. Ubuntu 18 LTS netplan 网络配置

    一.配置网络 1.通过netplan配置网络 #配置网络 nulige@ubuntu:/etc/netplan$ sudo apt install ifupdown nulige@ubuntu:/et ...

  5. 转: 关于linux用户时间与系统时间的说明

    写的很不错的一篇. https://blog.csdn.net/mmshixing/article/details/51307853

  6. [Vuex] Perform Async Updates using Vuex Actions with TypeScript

    Mutations perform synchronous modifications to the state, but when it comes to make an asynchronous ...

  7. Javascript 函数声明、函数表达式与匿名函数自执行表达式

    函数表达式(Function Expression)注:将函数定义为表达式语句(通常是变量赋值)的一部分 //func() 错误 var func = function () { } //func() ...

  8. 使用Guava的RateLimiter完成简单的大流量限流

    限流的一般思路: 1.随机丢弃一定规则的用户(迅速过滤掉90%的用户): 2.MQ削峰(比如设一个MQ可以容纳的最大消息量,达到这个量后MQ给予reject): 3.业务逻辑层使用RateLimite ...

  9. VS插件File Nesting

    开发者们一直以来都是使用Visual Studio的解决方案管理器 中的嵌套功能管理项目的子文件夹,使得文件组织清晰.便于访问.鉴于现在的项目巨大的文件数目,如果能将这种嵌入能力应用于项目的其他子项上 ...

  10. PowerShell 显示气球提示框 2

    https://www.itninja.com/blog/view/reboot-required-toast-notifications-for-windows-machines [void][Sy ...