当前位置:网站首页>MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
MySQL error: expression 1 of select list is not in group by claim and contains nonaggre
2022-07-02 03:58:00 【Snow pine】
Catalog
An error is as follows :
Expression #2 of SELECT list is not in GROUP BY clause and contains
nonaggregated column ‘sss.month_id’ which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
The cause of the problem :
MySQL 5.7.5 And the above functions depend on the detection function , If enabled ONLY_FULL_GROUP_BY SQL Pattern ( By default ),MySQL Selection list will be rejected ,HAVING Condition or ORDER BY The query reference of the list is in GROUP BY Unnamed non set column in clause , It doesn't depend on them in function .(5.7.5 Before ,MySQL No functional dependency detected , Not enabled by default ONLY_FULL_GROUP_BY, of 5.7.5 A description of the previous behavior , Please see the “MySQL 5.6 Reference manual ”.)
Solution 1 :
open navcat, use sql Inquire about :
select @@global.sql_modeThe value of the query is :
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONGet rid of ONLY_FULL_GROUP_BY, Reset value .
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’;Here's the picture :

Solution 2 :
The steps to success :
vim open :
sudo vim /etc/mysql/conf.d/mysql.cnfScroll to the bottom of the file, copy and paste
[mysqld]
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONTo the bottom of the file , Save and exit input mode
sudo service mysql restartrestart MySQL, complete ! Here's the picture :

--------------------------------------------------------------------------------------------------------
The environment I use is docker Container of lnmp Mirror image
Mirror address :2233466866/lnmp - Docker Image | Docker Hub
https://hub.docker.com/r/2233466866/lnmp
github Address :Home · 2233466866/lnmp Wiki (github.com)
https://github.com/2233466866/lnmp
Running commands :
# Pull the mirror image
docker pull 2233466866/lnmp
# Container generation
docker run -dit \
-p 80:80 \
-p 443:443 \
-p 3306:3306 \
-p 9000:9000 \
-v /home/user/www:/www \
-v /home/user/mysql:/data/mysql \
--privileged=true \
--name=lnmp \
# Container self starting ,--restart=no It is not self starting
--restart=always \
2233466866/lnmp【 End 】
边栏推荐
- Realizing deep learning framework from zero -- Introduction to neural network
- Three ways for programmers to learn PHP easily and put chaos out of order
- Oracle 常用SQL
- Sorted out an ECS summer money saving secret, this time @ old users come and take it away
- JVM knowledge points
- 蓝桥杯单片机省赛第七届
- 【小技巧】使用matlab GUI以对话框模式读取文件
- Which product of anti-cancer insurance is better?
- 2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有
- Vite: scaffold assembly
猜你喜欢

Demonstration description of integrated base scheme

蓝桥杯单片机省赛第八届

【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真

The original author is out! Faker. JS has been controlled by the community..

The first practical project of software tester: web side (video tutorial + document + use case library)

Visual slam Lecture 3 -- Lie groups and Lie Algebras

蓝湖的安装及使用

2022-07-01:某公司年会上,大家要玩一食发奖金游戏,一共有n个员工, 每个员工都有建设积分和捣乱积分, 他们需要排成一队,在队伍最前面的一定是老板,老板也有建设积分和捣乱积分, 排好队后,所有

Flutter中深入了解MaterialApp,常用属性解析

【leetcode】34. Find the first and last positions of elements in a sorted array
随机推荐
C语言:逻辑运算和判断选择结构例题
Monkey test
The 5th Blue Bridge Cup single chip microcomputer provincial competition
蓝桥杯单片机省赛第十一届第一场
Go variables and constants
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
The 6th Blue Bridge Cup single chip microcomputer provincial competition
Is the product of cancer prevention medical insurance safe?
蓝桥杯单片机第四届省赛
Basic operations of MySQL database (based on tables)
Influence of air resistance on the trajectory of table tennis
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification
Go language naming specification
初识string+简单用法(二)
go 函数
Jetpack之LiveData扩展MediatorLiveData
go 分支与循环
Object oriented thinking
It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
蓝湖的安装及使用