当前位置:网站首页>MySQL error: expression 1 of order by claim is not in group by claim and contains nonaggregated column
MySQL error: expression 1 of order by claim is not in group by claim and contains nonaggregated column
2022-06-29 16:04:00 【Long lasting bangbangjun】
Problem description
Wrong presentation
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
Error reporting analysis
This is the database sql_mode There's something wrong with the settings .Mysql Can support different SQL Pattern , Different SQL Patterns have different syntax , Perform different data verification profiles .
MySQL5.7 The default setting for the above version is mysql sql_mode = only_full_group_by attribute , Result in an error .
solve
Mode one : To settle temporarily ( restart mysql Error will still be reported later )
First step SELECT @@sql_mode;
The query result is :
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
The second step
Get rid of ONLY_FULL_GROUP_BY Reset value
SET @@global.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
The third step
Above is the change of the overall situation sql_mode Valid for new database , For existing databases , It needs to be executed under the corresponding data :SET sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Mode two : Permanent solution - Modify the configuration file
window Computer modification mysql Medium my.ini The configuration file ,linux and max modify myslq Medium my.ref file
Specific operation :
stay [mysqld] Below segment , Add the following
about mysql5.7 edition :sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
about 8 Above version : Get rid of NO_AUTO_CREATE_USER, as follows sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
边栏推荐
- 墨天轮“高可用架构”干货文档分享(含Oracle、MySQL、PG资料124篇)
- 微博评论高可用高性能计算架构
- 华为云AOM 2.0版本发布
- #夏日挑战赛# HarmonyOS - 方舟开发框架ArkUI 流光按钮效果
- JD health responded that it planned to acquire JD assets with us $355.4 million: related to pet health product category
- 2022年第一季度保险服务数字化跟踪分析
- swoole TCP 分布式实现
- 如何在 WordPress 中嵌入 iFrame
- 智能聊天机器人的优势在哪里?资深独立站卖家告诉你!
- 《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)
猜你喜欢

路由汇总带来的三层环路-解决实验

The way of enterprise transformation and upgrading: digital transformation, thinking first

BS-GX-018 基于SSM实现在校学生考试系统

面试官:说一下MySQL事务隔离级别?

three. JS and Gaode map are combined to introduce obj format model - effect demonstration

Timecho of Tianmou technology completed Angel round financing of nearly RMB 100 million and built the original time series database of the industrial Internet of things around Apache iotdb

《网络是怎么样连接的》读书笔记 - 服务器端的局域网中(四)

架构实战营模块五作业

mysql数据库基础:数据类型介绍

scratch报时的公鸡 电子学会图形化编程scratch等级考试一级真题和答案解析2022年6月
随机推荐
C language big job - Matching System
《网络是怎么样连接的》读书笔记 - WEB服务端请求和响应(五)
Leetcode-234-palindrome linked list
#夏日挑战赛# HarmonyOS - 方舟开发框架ArkUI 流光按钮效果
C語言大作業——匹配系統
面试官:说一下MySQL事务隔离级别?
How can I repair a slow WordPress website?
等保测评结论为差,是不是表示等保工作白做了?
Timecho of Tianmou technology completed Angel round financing of nearly RMB 100 million and built the original time series database of the industrial Internet of things around Apache iotdb
支付宝“安全锁”入选信通院“护童计划”优秀案例:超过33万用户已开通游戏保护
关于 国产麒麟系统运行Qt,在命令行可以运行而双击无法运行(无反应) 的解决方法
[data analysis] five common questions about learning SQL?
如何在 WordPress 中嵌入 iFrame
攻防演练之战前扫雷:漏洞管理的5大措施
A. Marathon
Pre war minesweeping: five measures for vulnerability management
Business Intelligence BI and business management decision-making thinking No. 3: business quality analysis
The way of enterprise transformation and upgrading: digital transformation, thinking first
作为开发人员,无代码开发平台 iVX 你有必要了解一下
El table column row button anti weight control loading