zoukankan      html  css  js  c++  java
  • MySQL5.7.21报错:[Err] 1055

    [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> show variables like 'sql_mode';
    +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+
    | Variable_name | Value |
    +---------------+-------------------------------------------------------------------------------------------------------------------------------------------+
    | sql_mode | ONLY_FULL_GROUP_BY,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)

    mysql> SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
    Query OK, 0 rows affected (0.00 sec)

    mysql> show variables like 'sql_mode';
    +---------------+------------------------------------------------------------------------------------------------------------------------+
    | Variable_name | Value |
    +---------------+------------------------------------------------------------------------------------------------------------------------+
    | 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.01 sec)

    vi /etc/my.cnf

    添加:

    sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  • 相关阅读:
    [bzoj1797] [Ahoi2009]Mincut 最小割
    [bzoj3343] 教主的魔法
    [bzoj3702] 二叉树
    [bzoj3809] Gty的二逼妹子序列
    JavaScript的面向对象原理之原型链
    javaScript操作DOM深入理解
    BOM浏览器对象模型
    JavaScript
    DAO模式
    使用ADO.NET访问数据库
  • 原文地址:https://www.cnblogs.com/elontian/p/8758039.html
Copyright © 2011-2022 走看看