目录:

  错误信息

  原因分析

  解决方案

  操作示例



  • 错误信息

    [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 -AWelcome 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'
      

转载于:https://www.cnblogs.com/halberd-lee/p/9876048.html

Mysql err 1055相关推荐

  1. linux系统mysql报err1055_MySQL Err 1055的解决

    同事在5.7.14的mysql上创建的表,需要在服务器上同步,但是小版本变成了5.7.17(不知道与版本有没有关系) 在Navicat里执行创建表的sql命令时,报错Err 1055 [Err] 10 ...

  2. mysql创建表报错1055的原因_[Err] 1055

    mysql 创建表是出现[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains non ...

  3. MySQL报错1055解决办法:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains

    [mysql报错1055 报错解决办法][Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and cont ...

  4. 执行sql语句提示[Err] 1055 - Expression #2 of SELECT list is not in GROUP BY......错误的解决办法

    当我在navicat中执行sql语句时,出现错误提示[Err] 1055 - Expression #2 of SELECT list is not in GROUP BY clause and co ...

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

    mysql客户端查询报这个错误,如下所示: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and co ...

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

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

  7. linux mysql 1055_mysql 1055错误

    线上用的MySQL版本为5.7.11,线下用的5.6版本,发现将程序上线后,有些地方报这个错误 [Err] 1055 - Expression #1 of ORDER BY clause is not ...

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

    今天在使用MySQL查询时报了一个"[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and c ...

  9. MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

    [实施工程师]MySQL:[Err] 1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'CREATE_TIME' a ...

最新文章

  1. android 点击扩散,Android水波纹扩散效果
  2. 好用的浏览器_“遇见”一个好用的浏览器,功能非常强大到无法想象
  3. VSTO---excel编程 [待续] [12月5日更新,详见文档下面]
  4. [iOS Animation]-CALayer 变换
  5. Android Jetpack 之 ViewModel
  6. 中文命名实体识别,HMM,CRF,BiLSTM,BiLSTM+CRF的具体实现
  7. python编程入门-最好的Python入门教材是哪本?
  8. 可视化理解卷积神经网络 - 反卷积网络 - 没看懂
  9. unity 灯光阴影
  10. Android旅游APP类项目源代码
  11. (转) [it-ebooks]电子书列表
  12. ue4 源码编译 虚拟内存不足 堆限制
  13. noip模拟赛 whzzt-Warmth
  14. 半加器设计(结构描述法)
  15. 联想小新V1000外接R9-380显卡
  16. 何谓坚强----悼大哥
  17. SUBTOTAL函数的应用
  18. 分酒问题与JOJ 1200 Jugs
  19. java lua_请问该如何在Java中使用Lua脚本语言?
  20. springboot+quartz报错:Table ‘XXXX.QRTZ_TRIGGERS‘ doesn‘t exist

热门文章

  1. 获取数据库链接Junit
  2. 在 Linux 的应用中测试中的延时和丢包模拟
  3. 西部动力成功中标围场县政府网站群建设项目
  4. Linux系统下文件与目录操作
  5. 移动超级sim卡 无法下载卡_共迎未来无限可能!5G超级SIM卡亮相2019中国移动全球合作伙伴大会...
  6. 有哪些可以让人清醒的创业失败故事
  7. 转载关于星座理论的套路
  8. 【转载】什么时候该选C语言实现业务逻辑,什么时候该选Python?
  9. Go调用zlib实现压缩与解压缩
  10. AnySDK项目实战教程