当前位置:网站首页>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 !
边栏推荐
- Firefox old version
- It can carry 100 people! Musk releases the strongest "starship" in history! Go to Mars as early as next year!
- The difference and use between get request and post request
- 时间序列-ARIMA模型
- Solve the problem that ${pagecontext.request.contextpath} is invalid
- MapReduce instance (III): data De duplication
- Example of the task submitted by the Flink packer
- Flask connects to existing tables in MySQL database
- Vant UI toast and dialog use
- 编码技巧——全局日志开关
猜你喜欢

The image displayed online by TP5 is garbled

EXE程序加密锁

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

减小PDF文档大小(转载)

Excel extract duplicates

Security software related to wireless network analysis (airtrack ng)

Flume incrementally collects MySQL data to Kafka

Excel提取重复项

Find active SQL connections in SQL Server

插入word中的图片保持高dpi方法
随机推荐
Sudden! 28 Chinese entities including Hikvision / Dahua / Shangtang / Kuangshi / ITU / iFLYTEK have been blacklisted by the United States
__ The difference between typeof and typeof
Coding skills - Global exception capture & unified return body & Business exception
Mapreduce实例(二):求平均值
Makefile specifies the path of the library file loaded when the program runs
解决flink启动后无法正常关闭
Some queries of TP5
mysql设置密码时报错 Your password does not satisfy the current policy requirements(修改·mysql密码策略设置简单密码)
Taking advantage of 5g Dongfeng, does MediaTek want to fight the high-end market again?
const小结
Axure 安装图标字体元件库
Const summary
word中插入度的方法
第31回---第52回
Two methods of generating excel table with PHP
Mysql5.7 master-slave hot standby settings on CentOS
Coturn service installation in webrtc
Security software related to wireless network analysis (airtrack ng)
flink打包程序提交任务示例
Firefox old version