• 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

  • 相关阅读:
    表单标签
    无序列表有序列表
    跳转锚点
    HTML标签01
    HTML基本结构和属性
    python爬虫学习笔记(二十三)-Scrapy框架 CrawlSpider
    python爬虫学习笔记(二十二)-Scrapy框架 案例实现
    python爬虫学习笔记(二十一)-Scrapy框架 setting
    python爬虫学习笔记(二十)-Scrapy框架 Pipeline
    python爬虫学习笔记(十九)-Scrapy 数据的保存
  • 原文地址:https://www.cnblogs.com/elontian/p/8758039.html
Copyright © 2020-2023  润新知