当前位置:网站首页>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 】
边栏推荐
- 【人员密度检测】基于形态学处理和GRNN网络的人员密度检测matlab仿真
- Opencv learning example code 3.2.4 LUT
- 【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
- Account management of MySQL
- go 语言命名规范
- Monkey test
- 初识P4语言
- Demonstration description of integrated base scheme
- [ibdfe] matlab simulation of frequency domain equalization based on ibdfe
- Basic syntax of unity script (7) - member variables and instantiation
猜你喜欢

JVM知识点

蓝桥杯单片机省赛第六届
![[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network](/img/11/4a8b52603e6e14a1ed6da1264dee57.png)
[personnel density detection] matlab simulation of personnel density detection based on morphological processing and GRNN network

Homework in Chapter 3 of slam course of dark blue vision -- derivative application of T6 common functions

The 7th Blue Bridge Cup single chip microcomputer provincial competition

Qt插件之Qt Designer插件实现

Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface

First acquaintance with string+ simple usage (II)

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

蓝桥杯单片机省赛第五届
随机推荐
MD5 of Oracle
傅里叶级数
0 foundation how to learn automated testing? Follow these seven steps step by step and you will succeed
【直播回顾】战码先锋首期8节直播完美落幕,下期敬请期待!
蓝桥杯单片机省赛第十一届
藍湖的安裝及使用
Learn more about materialapp and common attribute parsing in fluent
[untitled]
Delete the code you wrote? Sentenced to 10 months!
0基础如何学习自动化测试?按照这7步一步一步来学习就成功了
Pandora IOT development board learning (RT thread) - Experiment 1 LED flashing experiment (learning notes)
What is the logical structure of database file
In wechat applet, the externally introduced JS is used in xwml for judgment and calculation
Opencv learning example code 3.2.4 LUT
SQL:常用的 SQL 命令
集成底座方案演示说明
Object oriented thinking
【无线图传】基于FPGA的简易无线图像传输系统verilog开发,matlab辅助验证
Influence of air resistance on the trajectory of table tennis
ImageAI安装