当前位置:网站首页>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_mode
The 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_SUBSTITUTION
Get 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.cnf
Scroll 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_SUBSTITUTION
To the bottom of the file , Save and exit input mode
sudo service mysql restart
restart MySQL, complete ! Here's the picture :
--------------------------------------------------------------------------------------------------------
The environment I use is docker Container of lnmp Mirror image
Mirror address :2233466866/lnmp - Docker Image | Docker Hubhttps://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 】
边栏推荐
- 【leetcode】81. Search rotation sort array II
- Fingertips life Chapter 4 modules and packages
- Cloud service selection of enterprises: comparative analysis of SaaS, PAAS and IAAs
- 【力扣刷题】15.三数之和(双指针);17.电话号码的字母组合(递归回溯)
- Go branch and loop
- Interface debugging tool simulates post upload file - apipost
- [tips] use Matlab GUI to read files in dialog mode
- Three ways for programmers to learn PHP easily and put chaos out of order
- 5g era is coming in an all-round way, talking about the past and present life of mobile communication
- go 变量与常量
猜你喜欢
A thorough understanding of the development of scorecards - the determination of Y (Vintage analysis, rolling rate analysis, etc.)
Analysis of the overall design principle of Nacos configuration center (persistence, clustering, information synchronization)
Wpviewpdf Delphi and Net PDF viewing component
Haute performance et faible puissance Cortex - A53 Core Board | i.mx8m mini
Installation and use of blue lake
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
The 9th Blue Bridge Cup single chip microcomputer provincial competition
蓝桥杯单片机省赛第八届
The 8th Blue Bridge Cup single chip microcomputer provincial competition
高性能 低功耗Cortex-A53核心板 | i.MX8M Mini
随机推荐
u本位合约爆仓清算解决方案建议
Influence of air resistance on the trajectory of table tennis
Basic syntax of unity script (6) - specific folder
Installation et utilisation du lac bleu
[ibdfe] matlab simulation of frequency domain equalization based on ibdfe
[Li Kou brush questions] 15 Sum of three numbers (double pointer); 17. Letter combination of phone number (recursive backtracking)
The second game of the 11th provincial single chip microcomputer competition of the Blue Bridge Cup
SQL Yiwen get window function
Learn more about materialapp and common attribute parsing in fluent
蓝桥杯单片机省赛第十二届第一场
软件测试人的第一个实战项目:web端(视频教程+文档+用例库)
【IBDFE】基于IBDFE的频域均衡matlab仿真
Vite: scaffold assembly
Lost a few hairs, and finally learned - graph traversal -dfs and BFS
整理了一份ECS夏日省钱秘籍,这次@老用户快来领走
Blue Bridge Cup single chip microcomputer sixth temperature recorder
In wechat applet, the externally introduced JS is used in xwml for judgment and calculation
树莓派GPIO引脚控制红绿灯与轰鸣器
uni-app - 实现获取手机验证码倒计时 60 秒(手机号+验证码登录功能)
Fourier series