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

  • 相关阅读:
    flask的Request对象
    Spinner实现列表下拉功能
    ListView用法
    DatePickerDialog和TimePickerDialog(基于对话框显示时间和日期)
    DataPicker以及TimePicker显示时间和日期(屏幕上显示)
    Floyd-Warshall算法(最短路)
    Bellman-Ford算法(最短路)
    前向星
    css3变形与动画
    CSS3背景 background-size
  • 原文地址:https://www.cnblogs.com/elontian/p/8758039.html
Copyright © 2011-2022 走看看