今天在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. K Besk [POJ 3111]

    描述 Demy有n颗宝石.她的每个珠宝都有一些价值vi和重量wi.自从丈夫约翰在最近的金融危机爆发后,已经决定出售一些珠宝.她决定自己会保留最好的珠宝.她决定保留这样的宝石,使他们的具体价值尽可能大. ...

  2. Yii2 组件

    组件的命名空间: 响应组件: yii\web\Response Yii预定义的HTTP异常组件: yii\web\BadRequestHttpException: //状态码 400. yii\web ...

  3. 3ds max学习笔记(七)-- 实例操作(桌子)

    首先[自定义]/[单位设置],将公制和系统的单位都设置成mm(毫米) 若软件右侧无[标准基本体]那么可以选择[创建]/标准基本体/扩展基本体.... 1.创建一个长方体(作为桌面)完成后,点击菜单栏[ ...

  4. Ruby零碎笔记

    Ruby零碎笔记 飞机上阅读pdf的笔记,因为不联网,内容不多而且比较零散,以tips的形式记录 tips 查看当前作用域的变量 puts local_variables ruby中方法传递参数时,括 ...

  5. POJ1068 --(模拟)

    这题是在看一个书的时候的一个例题,当时并不明白啥意思,于是便找了下原题,以前没在POJ上刷过,这是开了个头,以后努力刷这个网站 题目大概意思是:http://poj.org/problem?id=10 ...

  6. python之进程和线程2

    1  GIL全局解释器锁定义 定义:在一个线程拥有了解释器的访问权后,其他的所有线程都必须等待他释放解释器的访问权,即这些线程的下一条指令并不会互相影响. 缺点:多处理器退化为单处理器 优点:避免大量 ...

  7. JSP(2)—绝对路径与相对路径、配置Servlet与Servlet注解

    一.绝对路径和相对路径 ①开发时建议使用据对路径,使用绝对路径肯定没有问题,但是用相对路径可能会有问题. 在由Servlet转发到JSP页面时,此时在浏览器地址栏显示Sevvlet路径,若JSP页面的 ...

  8. .net分布式系统架构的思路

    首先说明的是.net下开源内容较少,并且也不是做并行数据库等基础服务,因此在这里什么Hadoop.Spark.ZooKeeper.dubbo等我们暂不去考虑. 一.最初假设的网站中,我们把应用系统网站 ...

  9. gdb调试动态链接so

    http://blog.csdn.net/weed_hz/article/details/12710429 gdb) file <你的exe>(gdb) load <你的so> ...

  10. 如何将excel 数据库表结构生成powerdesign物理模型

    Option Explicit Dim mdl ' the current model Set mdl = ActiveModel If (mdl Is Nothing) Then MsgBox &q ...