zoukankan      html  css  js  c++  java
  • MySQL报错this is incompatible with sql_mode=only_full_group_by

     1、报错信息

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP BY, expression #2 of SELECT list contains nonaggregated column 'd.total_rated_power_transformer'; this is incompatible with sql_mode=only_full_group_by

    2、修改配置文件

     (1)找到配置文件my.cfg

     find / -name "my.cnf"

     (2)修改配置文件

     vi /etc/my.cnf
    加一行
    sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    如果原本有sql_mode,去掉ONLY_FULL_GROUP_BY

    3、重启mysql使配置生效

    service mysqld restart

  • 相关阅读:
    poj 1850/poj 1496
    poj 1035
    poj 3252
    hdoj 1013
    poj 2965
    poj 1844
    poj 2309
    蓝桥杯比赛回来后计划。。。
    山大实训第二周感想
    hadoop——Map/Reduce中combiner的使用
  • 原文地址:https://www.cnblogs.com/yybrhr/p/10158911.html
Copyright © 2011-2022 走看看