当前位置:网站首页>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 !
边栏推荐
猜你喜欢

Draw circuit diagram according to Verilog code

centos yum方式安装mysql

The difference and use between get request and post request

Security software related to wireless network analysis (airtrack ng)

Characters generated by JMeter function assistant in jmeter5.3 and later versions cannot be copied when they are grayed out

The new JMeter function assistant is not under the options menu - in the toolbar

Content ambiguity occurs when using transform:translate()

training on multiple GPUs pytorch

Web test learning notes 01

Mapreduce实例(一):WordCount
随机推荐
TSMC's 6-nanometer manufacturing process will enter trial production in the first quarter of next year
solidwork装配体导入到Adams中出现多个Part重名和Part丢失的情况处理
The new JMeter function assistant is not under the options menu - in the toolbar
const小结
Coturn service installation in webrtc
Introduction to JWT
大数相加
Easy to understand, distinguish between ++i and I++
centos yum方式安装mysql
Mapreduce实例(三):数据去重
Join hands with sifive, Galanz will enter the semiconductor field! Exposure of two self-developed chips
mysql设置密码时报错 Your password does not satisfy the current policy requirements(修改·mysql密码策略设置简单密码)
Oracle 常用语句
Security software related to wireless network analysis (airtrack ng)
Thesis reduction
Introduction and use of redis
word中插入度的方法
DRF learning notes (II): Data deserialization
Your password does not satisfy the current policy requirements (modify MySQL password policy setting simple password)
时间序列-ARIMA模型