zoukankan      html  css  js  c++  java
  • mysql 8.0下的SELECT list is not in GROUP BY clause and contains nonaggregated column

    mysql的版本

    mysql> select version();
    +-----------+
    | version() |
    +-----------+
    | 8.0.12 |
    +-----------+

    在执行group  by时遇到报错,具体如下

    mysql> select * from api_properties GROUP BY file_id order by file_id;
    1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bim.api_properties.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

    记得上次在5.7下也遇到了同样的问题  5.7的

    win下修改my.ini,添加

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

    重启mysql

    启动失败,描述为

    2019-08-27T09:22:54.827016Z 0 [ERROR] [MY-011071] [Server] D:phpstudy_proCOM..ExtensionsMySQL8.0.12\binmysqld.exe: Error while setting value 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'

    2019-08-27T09:22:54.827016Z 0 [ERROR] [MY-010119] [Server] Aborting

    2019-08-27T09:22:54.828016Z 0 [Note] [MY-010120] [Server] Binlog end

    NO_AUTO_CREATE_USER 在 5.7.* 的日志中提到已废除该模式,在 8.0.11 中删除了

    修改设置为

    sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

    重启mysql,问题解决

  • 相关阅读:
    ubuntu 访问 共享 windows文件夹
    ubuntu下android环境的搭建
    smb使用 ------转载自http://blog.csdn.net/tlaff/article/details/5463068
    oracle jar
    悬浮按钮
    移动开发赚钱
    截取scrollview的滑动事件,传递给子控件
    put ListView in a ScrollView(bug fixed)
    35岁前务必成功的12级跳
    mysql分页原理和高效率的mysql分页查询语句
  • 原文地址:https://www.cnblogs.com/baby123/p/11419655.html
Copyright © 2011-2022 走看看