zoukankan      html  css  js  c++  java
  • Expression #1 of ORDER BY clause is which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

     问题

    linux下安装mysql,每次执行sql语句都报错。

    本次执行的命令如下:

    update flow_station set station_name='批次绑定1'
     WHERE id = 430 and flow_id= 111 ; update flow_station set station_name='组装绑定1'
     WHERE id = 431 and flow_id= 111 ; update flow_station set station_name='批次绑定2'
     WHERE id = 432 and flow_id= 111 ; update flow_station set station_name='组装绑定2'
     WHERE id = 433 and flow_id= 111;

    虽然最终成功还是报以下错误:

    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版本

    SELECT version()

    结果

    5.7.30-0ubuntu0.16.04.1

    解决方法

    sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

    编辑文件,在[mysqld]下面添加以下代码

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

    重启服务

    sudo service mysql restart

    转载自:https://blog.csdn.net/u014520745/article/details/76056170

  • 相关阅读:
    微信小程序通过CODE换取session_key和openid
    BZOJ1497[NOI2006]最大获利——最大权闭合子图
    Leetcode#149 Max Points on a Line
    IO流总结
    java基础比较好的笔记总结
    chrome web开发工具
    day 01 常量 注释 int(整型) 用户交互input 流程控制语句if
    10.2:异或树经验
    搜索+保存路径
    搜索+简单dp
  • 原文地址:https://www.cnblogs.com/passedbylove/p/13175205.html
Copyright © 2011-2022 走看看