zoukankan      html  css  js  c++  java
  • Mysql插入数据时,报错this is incompatible with sql_mode=only_full_group_by

    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

    第一步:查看数据库的sql_mode的值

      select version(),@@sql_mode;

    第二步:设置需要的sql_mode

      SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

    mysql5.7中sql_mode的含义解释

    sql_mode 含义
    ONLY_FULL_GROUP_BY 不要让GROUP BY部分中的查询指向未选择的列
    STRICT_TRANS_TABLES 为事务存储引擎启用严格模式,也可能为非事务存储引擎启用严格模式
    NO_ZERO_IN_DATE 在严格模式,不接受月或日部分为0的日期
    NO_ZERO_DATE 在严格模式,不将 '0000-00-00'做为合法日期
    ERROR_FOR_DIVISION_BY_ZERO 在严格模式,在INSERT或UPDATE过程中,如果被零除(或MOD(X,0)),则产生错误
    NO_AUTO_CREATE_USER 防止GRANT自动创建新用户,除非还指定了密码
    NO_ENGINE_SUBSTITUTION  如果需要的存储引擎被禁用或未编译,可以防止自动替换存储引擎
  • 相关阅读:
    FOJ2250 不可能弹幕结界
    寻找最大值
    Haybale Guessing
    MG loves string
    Curious Cupid
    Anton and Permutation
    TLE
    Jzzhu and Numbers
    Divisible Group Sums
    The merchant
  • 原文地址:https://www.cnblogs.com/guduershi/p/10608029.html
Copyright © 2011-2022 走看看