当前位置:网站首页>MySQL high version report SQL_ mode=only_ full_ group_ By exception
MySQL high version report SQL_ mode=only_ full_ group_ By exception
2022-07-27 16:24:00 【Tony-devj】
Mysql High edition newspaper sql_mode=only_full_group_by abnormal
Recently, there is a need for statistical data operation , You need to use the function of grouping and count , Here is the report sql_mode=only_full_group_by
stay mysql There are relevant descriptions on the official website
Error number: 3087; Symbol: ER_WRONG_FIELD_WITH_GROUP_V2; SQLSTATE: HY000
Message: Expression #%u of %s is not in GROUP BY clause and contains nonaggregated column '%s' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
The above prompt means sql_mode The problem of incompatibility , Here's the solution
This error usually occurs in mysql 5.7 as well as 5.7 In the previous version , The reason is mysql In the default configuration of ,sql_mode=“ONLY_FULL_GROUP_BY” This configuration is strictly enforced ‘SQL92 standard ’, So high website maintenance personnel are upgrading mysql version , Will be modified sql_mode Configuration of , Make it compatible with .
Temporary treatment sql_mode
Query Global sql_mode
SELECT @@GLOBAL.sql_mode;
# Set up
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';
But this temporary solution , restart mysql The above problems will also appear
Modify by configuration
There has been linux For example :
modify /etc/my.cnf
stay [mysqld] Add the following configuration :
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
After modification , restart mysql that will do
service mysqld restart
It's going on group by The operation will be successful !
边栏推荐
- The 4.3 billion euro cash acquisition of OSRAM failed! AMS said it would continue to acquire
- DRF use: get request to get data (small example)
- my_ls小结
- webRTC中的coturn服务安装
- Determine the exact type of data
- Simulation生成报表
- Mapreduce实例(二):求平均值
- Install MySQL using CentOS yum
- Two methods of generating excel table with PHP
- MySQL索引
猜你喜欢
随机推荐
Time series ARIMA model
Vant UI toast and dialog use
pdf 提取文字
Yys mouse connector
2021-03-09
The image displayed online by TP5 is garbled
IO stream introduction
Simulation生成报表
training on multiple GPUs pytorch
Your password does not satisfy the current policy requirements (modify MySQL password policy setting simple password)
Some queries of TP5
Pointer summary
For enterprise operation and maintenance security, use the cloud housekeeper fortress machine!
IO流简介
Leetcode 226 flip binary tree (recursive)
centos上mysql5.7主从热备设置
企业运维安全就用行云管家堡垒机!
google chrome revercecaptcha广告屏蔽
Solve the problem that Flink cannot be closed normally after startup
指针总结









