当前位置:网站首页>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 】
边栏推荐
- The 5th Blue Bridge Cup single chip microcomputer provincial competition
- The 10th Blue Bridge Cup single chip microcomputer provincial competition
- Basic syntax of unity script (7) - member variables and instantiation
- MD5 of Oracle
- The 6th Blue Bridge Cup single chip microcomputer provincial competition
- 树莓派GPIO引脚控制红绿灯与轰鸣器
- Introduction to Robotics II. Forward kinematics, MDH method
- pip 安装第三方库
- 【IBDFE】基于IBDFE的频域均衡matlab仿真
- Didi open source Delta: AI developers can easily train natural language models
猜你喜欢

蓝桥杯单片机省赛第六届

蓝桥杯单片机第六届温度记录器
![[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification](/img/77/4df7a1439ff1a53f94d409a19a47d6.png)
[wireless image transmission] FPGA based simple wireless image transmission system Verilog development, matlab assisted verification

Learn more about materialapp and common attribute parsing in fluent

Raspberry pie GPIO pin controls traffic light and buzzer

Hand tear - sort

集成底座方案演示说明

Vite: configure IP access

Qt插件之Qt Designer插件实现

The first game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
随机推荐
L'avènement de l'ère 5G, une brève discussion sur la vie passée et présente des communications mobiles
Finally got byte offer. The 25-year-old inexperienced perception of software testing is written to you who are still confused
Go language introduction
Which is better, industrial intelligent gateway or edge computing gateway? How to choose the right one?
【leetcode】81. Search rotation sort array II
The second game of the 12th provincial single chip microcomputer competition of the Blue Bridge Cup
The 5th Blue Bridge Cup single chip microcomputer provincial competition
[untitled]
"No war on the Western Front" we just began to love life, but we had to shoot at everything
The fourth provincial competition of Bluebridge cup single chip microcomputer
傅里叶级数
Object oriented thinking
Qt插件之Qt Designer插件实现
High performance and low power cortex-a53 core board | i.mx8m Mini
蓝桥杯单片机省赛第十一届第一场
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
go 变量与常量
Recently, the weather has been extremely hot, so collect the weather data of Beijing, Shanghai, Guangzhou and Shenzhen last year, and make a visual map
JVM knowledge points
Interface debugging tool simulates post upload file - apipost