当前位置:网站首页>columns in GROUP BY clause; this is incompatible with sql_ mode=only_ full_ group_ By mysql8.0 solution
columns in GROUP BY clause; this is incompatible with sql_ mode=only_ full_ group_ By mysql8.0 solution
2022-07-26 04:39:00 【Zu'an Dalong】
Questions as follows :
ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘jol.solution.nick’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
reason :
mysql5.7 The above is enabled by default only_full_group_by Options . My version is mysql8.0 The above
Windows terms of settlement :
Query and view first sql_mode The content in
select @@GLOBAL.sql_mode;
+-----------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode |
+-----------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION |
+-----------------------------------------------------------------------------------------------------------------------+
There are two solutions , The first is temporary solution , No cure , This problem will reappear when the database is restarted , The second is to modify my.ini The configuration file , Permanent cure , It's also convenient
Way 1:
Will find out sql_mode in ONLY_FULL_GROUP_BY Just delete it , Restart will fail
set @@GLOBAL.sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
Way 2:
Find yourself first mysql The installation path
select @@basedir;
+-----------+
| @@basedir |
+-----------+
| E:\mysql\ |
+-----------+
Then go into the folder and find your own my.ini The configuration file , modify [mysqld] The content in , Add the following content 

Be sure to add it to [mysqld] Inside , It's the following line of code , Is what will be found sql_mode in ONLY_FULL_GROUP_BY delete
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
Then exit the database , Restart in the service MySQL Can 
Ubuntu System /Linux System solutions
My database configuration file exists /etc/mysql/mysql.conf.d/mysqld.cnf in , So open this file directly
vim /etc/mysql/mysql.conf.d/mysqld.cnf
Type after opening the file
i # Insert command
Will enter this configuration file 
This may happen. It's useless to slide the mouse wheel , Use the keyboard keys to pull down 
Follow windows equally , add to sql_mode, Also delete ONLY_FULL_GROUP_BY The last string of things , After entering, type Esc, Will exit the insert mode , Then type :wq Press enter to save the file , Then restart MySQL Can
Restart command :
sudo service mysql restart
Then enter MySQL Enter the following code to view , that will do
select @@GLOBAL.sql_mode;

边栏推荐
- Page pull-up refresh and pull-down loading
- Postman imports curl, exports curl, and exports corresponding language codes
- 数组排序3
- An SQL server queries the latest records as of a certain date
- egg-ts-sequelize-CLI
- A series of problems about the number of DP paths
- [learning notes] agc041
- Face database collection summary
- 性能和成本的综合架构:单元化架构
- 软考回顾及计划
猜你喜欢

理性认知教育机器人寓教于乐的辅助作用

idea插件离线安装(持续更新)

Offline installation of idea plug-in (continuous update)

滑动窗口——leetcode题解

2022 Henan Mengxin League game (3): Henan University L - synthetic game

egg-ts-sequelize-CLI

How does win11 22h2 skip networking and Microsoft account login?

UE4 switching of control rights of multiple roles

1. If function of Excel

Phaser(一):平台跳跃收集游戏
随机推荐
Rotate array minimum number
【UOJ 429】串串划分(Runs)(容斥)+ 有关 Lyndon Tree 及其应用的小小记录
idea插件离线安装(持续更新)
Postman 导入curl 、导出成curl、导出成对应语言代码
第三篇如何使用SourceTree提交代码
autocomplete禁止表单自动填充
Comparison of the relationship between the number of partitions and the number of reducetask in MapReduce
UE4 two ways to obtain player control
Swiftui one day crash
[300 + selected interview questions from big companies continued to share] big data operation and maintenance sharp knife interview question column (VIII)
IEC61131 数据类型与 C#数据类型的对应
十一、异常处理器
数据仓库
Keil V5 installation and use
UE4 获取玩家控制权的两种方式
The difference between positive samples, negative samples, simple samples and difficult samples in deep learning (simple and easy to understand)
vector详解和迭代器失效问题
2022 Henan Mengxin League game (3): Henan University L - synthetic game
2022杭电多校第二场 A.Static Query on Tree(树剖)
2022河南萌新联赛第(三)场:河南大学 A - 玉米大炮