"ヾ(◍°∇°◍)ノ゙加油哟~","愿我们不负昭华,以梦为马!","愿我们历尽千帆,归来仍是少年!"

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

[Err] 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

1
select version(), @@sql_mode;

  

 

1
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

  

 

 

 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
1、 解决办法: 把 sql_mode中的 only_full_group_by 去掉即可。
2、 办法一 (只在当前查询页面有效,不能一次性解决问题!):
select version(), @@sql_mode;
SET sql_mode=(SELECT REPLACE(@@sql_mode,‘ONLY_FULL_GROUP_BY’,’’));
 
3、办法二: 修改 my.cnf 文件的 sql_mode (一次性解决问题)
查找 my.cnf 文件: find / -name my.cnf 或者 whereis my.cnf
获取 sql_mode字段内容: SELECT @@sql_mode;
去掉 sql_mode字段中的 only_full_group_by
编辑 my.cnf: vim /etc/my.cnf 将上一步骤的 sql_mode 字段内容添加至 my.cnf
保存,重启: service mysqld restart
sql_mode 字段参考:
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

  

 

posted @   深夜独行侠  阅读(327)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
历史上的今天:
2018-11-24 mysql修改表、字段、库的字符集
2018-11-24 MySQL修改表的默认字符集和修改表字段的默认字符集
2018-11-24 Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionExcep linux下mysql修改连接超时wait_timeout修改后就ok了
点击右上角即可分享
微信分享提示