关键词搜索

源码搜索 ×
×

1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contai

发布2021-06-07浏览2011次

详情内容

1. 现象

在使用sql语句创建表时,报错:

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

2. docker内部mysql容器 解决方案

修改配置文件:在配置文件里加一句就可以了:

sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

    如果是docker中mysql容器请参考这篇博客,修改的是同一个文件
    解决Linux docker中的mysql区分大小写问题
    在这里插入图片描述

    3. windows和linux 解决方案

    windows的在安装目录里找到my.ini或者centos7在/etc/my.cnf中,添加内容如下:

    sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
    

      ,添加内容进去后,关掉mysql服务重启

      # 关
      net stop mysql
      # 启   
      net start mysql     
      
        2
      • 3
      • 4

      centos7在/etc/my.cnf中添加,重启

       service mysqld restart
       或者 
       systemctl restart mysqld
      
        2
      • 3

      相关技术文章

      点击QQ咨询
      开通会员
      返回顶部
      ×
      微信扫码支付
      微信扫码支付
      确定支付下载
      请使用微信描二维码支付
      ×

      提示信息

      ×

      选择支付方式

      • 微信支付
      • 支付宝付款
      确定支付下载