当前位置:网站首页>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;

边栏推荐
猜你喜欢

Threadpooltaskexecutor and ThreadPoolExecutor

Phaser (I): platform jumping collection game

嵌入式实操----基于RT1170 FreeRTOS实现CPU使用率统计(二十四)

UE4 通过按键控制物体的旋转

Postman 导入curl 、导出成curl、导出成对应语言代码

ASP. Net core actionfilter filter details

Steam science education endows classroom teaching with creativity

UE4 controls the rotation of objects by pressing keys

Database startup message: ora-29702: error occurred in cluster group service
![[300 + selected interview questions from big companies continued to share] big data operation and maintenance sharp knife interview question column (VIII)](/img/a0/b2b0f5fb63301f5b7dd14302aa39e2.png)
[300 + selected interview questions from big companies continued to share] big data operation and maintenance sharp knife interview question column (VIII)
随机推荐
Kubernetes 进阶训练营 调度器
egg-ts-sequelize-CLI
Comparison of the relationship between the number of partitions and the number of reducetask in MapReduce
二、国际知名项目-HelloWorld
Creative design principle of youth maker Education
Phaser (I): platform jumping collection game
软考回顾及计划
一、基础入门
Array sort 3
2022河南萌新联赛第(三)场:河南大学 B - 逆序对计数
Optimization analysis and efficiency execution of MySQL
Phaser(一):平台跳跃收集游戏
Compiled by egg serialize JS
FFmpeg 视频编码
Array sort 1
How to build an automated testing framework?
青少年创客教育的创意设计原理
Threadpooltaskexecutor and ThreadPoolExecutor
UE4 多个角色控制权的切换
Swiftui one day crash