GROUP BY clause and contains nonaggregated 报错处理
1055 - Expression #16 of SELECT list is not in GROUP BY clause and contains nonaggregated column 报错处理
源码想移植到新的机器,MySQL 使用PHPStudy 安装 升级到5.7.26 。
一切准备就绪但是,出现以上错误。
话不多说解决办法,
1、主要原因
Mysql默认
的 sql_mode 默认 ONLY_FULL_GROUP_BY 值,需要把它去掉。
2 去掉办法
尝试很多种办法,比如
MySQL>set @@global.sql_mode=(select replace(@@global.sql_mode,’ ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’,’’));
都无法去掉。
3 正确办法 windows 系统里,
编辑MySQL 安装目录里的 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
(只要把ONLY_FULL_GROUP_BY 去掉即可)
保存后,重启Mysql 问题解决。
————————————————
版权声明:本文为CSDN博主「noya202020」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/noya202020/article/details/119413241
GROUP BY clause and contains nonaggregated 报错处理的更多相关文章
- 【mybatis】【mysql】mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
mybatis查询mysql,group by分组查询报错:Expression #1 of SELECT list is not in GROUP BY clause and contains no ...
- 解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat
解决MySQL报错:1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'informat ...
- 解决mysql报错:- Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ'
mysql执行报错: - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c ...
- MySQL5.7.27报错[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated
mysql5.7.27在运行更新语句时出现如下情况,mysql5.6之前没有这种情况出现. of ORDER BY clause is not in GROUP BY clause and conta ...
- mysql 5.7 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ...报错
使用mysql在执行一条插入语句时 , ', "hhh"); 报错:Expression #1 of ORDER BY clause is not in GROUP BY clau ...
- MYSQL报错:1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rpa ...
- SELECT list is not in GROUP BY clause and contains nonaggregated column
报错如下: Expression # of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘sss.m ...
- Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
安装了mysql5.7.19后,执行语句中只要含有group by 就会报这个错 [Err] 1055 - Expression #1 of ORDER BY clause is not in GRO ...
- Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'blog.t_blog.addTime' which is not functi
sql报错: Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 of SELECT ...
- mysql 8.0下的SELECT list is not in GROUP BY clause and contains nonaggregated column
mysql的版本 mysql> select version();+-----------+| version() |+-----------+| 8.0.12 |+-----------+ 在 ...
随机推荐
- 如何成为10x倍工程师
10倍效率 +10x 的工程师很难找,但是 -10x 工程师是存在的. 所谓 -10x 工程师,就是每周要浪费团队 400 个小时的工程师. 他有以下特征: 创造无效的繁忙工作,比如演示文稿.图表.工 ...
- Python 变量:创建、类型、命名规则和作用域详解
变量 变量是用于存储数据值的容器. 创建变量 Python没有用于声明变量的命令. 变量在您第一次为其分配值时被创建. 示例 x = 5 y = "John" print(x) p ...
- C++调用Python-5:调用Python函数,传参数字+字符串
# mytest.py def myjoin(a, b): print("num a + str b") return f"{a}=={b}" #include ...
- java集合源码详解
一 Collection接口 1.List 1.1ArrayList 特点 1.底层实现基于动态数组,数组特点根据下表查找元素速度所以查找速度较快.继承自接口 Collection ->Lis ...
- Rancher 系列文章-K3S 集群升级
概述 书接上回:<Rancher 系列文章-Rancher 升级>, 我们提到:将 Rancher 用 Helm 从 v2.6.3 升级到 v2.6.4. 接下来开始进行 K3S 集群的升 ...
- 1、android Studio 打Jar包
1.创建一个AndroidStudio 工程 注意下面这个Package Name 2.进入Android Studio工程中 选择Project Flies 选项 然后找到 app->src- ...
- 利用PyTorch训练模型识别数字+英文图片验证码
利用PyTorch训练模型识别数字+英文图片验证码 摘要:使用深度学习框架PyTorch来训练模型去识别4-6位数字+字母混合图片验证码(我们可以使用第三方库captcha生成这种图片验证码或者自己收 ...
- 离线语音识别,vosk,离线流式实时静音噪声监测,支持多语言开发python c++ c# java等
#!/usr/bin/env python3 from vosk import Model, KaldiRecognizer, SetLogLevel import sys import os imp ...
- 向量数据库之Lancedb学习记录
简介 Lancedb是一个用于人工智能的开源矢量数据库,旨在存储.管理.查询和检索大规模多模式数据的嵌入.Lancedb的核心是用Rust编写的,并构建在Lance之上,专为高性能 ML 工作负载和快 ...
- 力扣289(java)-生命游戏(中等)
题目: 根据 百度百科 , 生命游戏 ,简称为 生命 ,是英国数学家约翰·何顿·康威在 1970 年发明的细胞自动机. 给定一个包含 m × n 个格子的面板,每一个格子都可以看成是一个细胞.每个细胞 ...