目录:

  错误信息

  原因分析

  解决方案

  操作示例



  • 错误信息

    [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column
    'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause;
    this is incompatible with sql_mode=only_full_group_by
  • 原因分析
    Mysql 中的SQL 语法并不是严格按照SQL 95 标准的。在聚合操作时,group by 允许不包含所有select的非聚合 列.

    参数sql_mode='ONLY_FULL_GROUP_BY' 可以使SQL 严格按照SQL 95标准编写,但是同时此参数是存在缺陷的。一些delete 等非聚合操作,从java 客户端发起时,有可能会引起错误:[err] 1055.

  • 解决方案
    简单的解决方案就是取消此参数设置。参数的设置方法如下:

    # 临时调整
    set @@sql_mode='参数列表,以逗号分隔'
    或者
    set global sql_mode='参数列表,以逗号分隔'
    # 永久调整 修改参数配置文件my.cnf
    sql_mode = '参数列表,不同参数之间以逗号分隔'
  • 示例
    • 临时修改示例

      mysql> 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';
      Query OK, 0 rows affected (0.00 sec)
      mysql> exit
      Bye
      [root@test ~]# mysql -D
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 1814164
      Server version: 5.7.17 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select @@sql_mode;
      +------------------------------------------------------------------------------------------------------------------------+
      | @@sql_mode |
      +------------------------------------------------------------------------------------------------------------------------+
      | STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
      +------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
    • 永久修改示例
      # 修改之前
      sql_mode='ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
      # 修改之后
      sql_mode='NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

Mysql err 1055的更多相关文章

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

    MySQL[Err]1055 上次MySQL5.7.19主从建立完成之后,所有的测试都是在MySQL命令行下进行的,最近用Navicat Premium进行MySQL的连接,然后在插入数据的时候MyS ...

  2. mysql [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GRO

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

  3. mysql主给备赋予权限时报错,MySQL [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause

    https://www.cnblogs.com/skymyyang/p/7551646.html 在my.cnf 里面设置sql_mode='STRICT_TRANS_TABLES,NO_ZERO_I ...

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

    参考 http://www.10qianwan.com/articledetail/220315.html

  5. mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY

    mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...

  6. mysql错误:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated

    今天迁移django数据库的时候,跑程序的时候出现这样的错误: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY cla ...

  7. MySql插入数据成功但是报[Err] 1055

    1.问题: 这两天做insert操作,mysql版本是5.7,insert后虽然成功了,但是会报一个[Err] 1055的错误.具体如下: 2.解决方案: linux环境下,vim到my.cnf,添加 ...

  8. [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 and contains nonaggregate ...

  9. [err] 1055

    本人mysql安装在ubuntu16.04上,mysql版本是5.7.19:在创建表和插入数据时报了 [Err] 1055 - Expression #1 of ORDER BY clause is ...

随机推荐

  1. php函数 array_diff

    array_diff ( array $array1 , array $array2 [, array $... ] ) : array 对比 array1 和其他一个或者多个数组,返回在 array ...

  2. 关于Java面试

    Java基础知识复习 1. 简单讲一下Java跨平台的原理 由于操作系统(Windows.Linux)支持的指令集,不是完全一致的.就会让我们程序在不同的操作系统上执行不同的代码.Java开发了不同操 ...

  3. SpringCloud学习笔记:服务注册与发现Eureka(2)

    1. Eureka简介 Eureka是一个用于服务注册和发现的组件,分为Eureka Server和Eureka Client,Eureka Server为Eureka服务注册中心,Eureka Cl ...

  4. SpringMVC DispatcherServlet在配置Rest url-pattern的一点技巧

    SpringMVC的Controller中已经有了@RequestMapping(value = "detail.do", method = RequestMethod.GET)的 ...

  5. 常用CSS3

    (ಥ_ಥ)    啊啊,我的胃好疼啊.感觉最近胃又开始不舒服了.啊——果然老了呢,想当初,我也是不坏金刚之身来着呢,唉,我的可怜的小胃胃   (ಥ_ಥ) 记录几个已经常见的不能再常见的css3样式. ...

  6. python之常用模块二(hashlib logging configparser)

    摘要:hashlib ***** logging ***** configparser * 一.hashlib模块 Python的hashlib提供了常见的摘要算法,如MD5,SHA1等等. 摘要算法 ...

  7. [洛谷P1357] 花园

    题目类型:状压\(DP\) -> 矩阵乘法 绝妙然而思维难度极其大的一道好题! 传送门:>Here< 题意:有一个环形花圃,可以种两种花:0或1. 要求任意相邻的\(M\)个花中1的 ...

  8. C++:位操作基础篇之位操作全面总结

    位操作篇共分为基础篇和提高篇,基础篇主要对位操作进行全面总结,帮助大家梳理知识.提高篇则针对各大IT公司如微软.腾讯.百度.360等公司的笔试面试题作详细的解答,使大家能熟练应对在笔试面试中位操作题目 ...

  9. Day039--HTML

    HTML小马哥博客 HTML CSS + DIV实现整体布局 1. HTML 超文本标记语言 对换行不敏感 空白折叠现象 标签要严格密封 新建HTML文件,输入 html:5,按tab键后,自动生成的 ...

  10. 数据库导出excel,前后端分离

    主要参考了这篇博文:https://www.cnblogs.com/jerehedu/p/4343509.html  2.3和2.4 采用xssf,依赖:compile group: 'org.apa ...