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 |+-----------+ 在 ...
随机推荐
- C++调用Python-5:调用Python函数,传参数字+字符串
# mytest.py def myjoin(a, b): print("num a + str b") return f"{a}=={b}" #include ...
- How to install Django-Install Python Django | Django 安装指南【官方版】
How to install Django¶ This document will get you up and running with Django. Install Python--Linux ...
- lattice的ipexpress异常,解决办法
最近ip服务器可能会遇到问题,建议客户把更新检查关掉.我们有对应的IP下载链接. https://www.latticesemi.com/ispupdate/ipexpress/ https://ra ...
- 力扣615(MySQL)-平均工资:部门与公司比较(困难)
题目: 给如下两个表,写一个查询语句,求出在每一个工资发放日,每个部门的平均工资与公司的平均工资的比较结果 (高 / 低 / 相同). 表: salary employee_id 字段是表 emplo ...
- 力扣539(java)-最小时间差(中等)
题目: 给定一个 24 小时制(小时:分钟 "HH:MM")的时间列表,找出列表中任意两个时间的最小时间差并以分钟数表示. 示例 1: 输入:timePoints = [" ...
- 欢迎 Llama 3:Meta 的新一代开源大语言模型
介绍 Meta 公司的 Llama 3 是开放获取的 Llama 系列的最新版本,现已在 Hugging Face 平台发布.看到 Meta 持续致力于开放 AI 领域的发展令人振奋,我们也非常高兴地 ...
- HarmonyOS NEXT应用开发—城市选择案例
介绍 本示例介绍城市选择场景的使用:通过AlphabetIndexer实现首字母快速定位城市的索引条导航. 效果图预览 使用说明 分两个功能 在搜索框中可以根据城市拼音模糊搜索出相近的城市,例如输入& ...
- 【实用教程】在配备持久内存的实例上部署Redis应用
简介:配备持久内存的实例(例如re7p.r7p.re6p)提供了超大CPU内存配比,Redis应用运行在这类实例上可以大幅度降低单GiB内存的成本.本文以部分操作系统为例,介绍如何在这类实例上快速部署 ...
- XAML 给资源起个好名字 用 StaticResource 起一个别名
本文来和大家聊一下关于 XAML 资源的定义的事情,和开发技术关系不大,更多的是开发的思路 在稍微大一点的项目里,肯定 XAML 资源是少不了的.对于 XAML 资源,行业里讨论多(非小白讨论)的是关 ...
- MSBuild 输出日志可视化工具 MSBuild Structured Log Viewer 简介
感谢 Vatsan Madhavan 小伙伴推荐的 MSBuild 输出日志可视化工具,这个工具可以使用漂亮的 WPF 界面预览 MSBuild 复杂的输出内容 这是一个完全开源的工具,请看 Kiri ...