当前位置:网站首页>修改mysql的分组报错Expression #1 of SELECT list is not in GROUP
修改mysql的分组报错Expression #1 of SELECT list is not in GROUP
2022-07-25 09:26:00 【colours starry sky】
方法一:
1、通过下方SQL语句查询:
SELECT @@sql_mode;
2、查看是否存在 ONLY_FULL_GROUP_BY字段?
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
3、如果存在上方字段,使用下方SQL语句:
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’;
方法二:
在mysql的安装目录下创建图中两个文件
**
my.ini文件内容:
**
#此数据库没有my.ini文件,当前文件为后来增加的
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_bin
init_connect=‘SET NAMES utf8mb4’
Remove leading # and set to the amount of RAM for the most important data
cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 128M
Remove leading # to turn on a very important data integrity option: logging
changes to the binary log between backups.
log_bin
These are commonly set, remove the # and set as required.
#该参数指定了安装 MySQL 的安装路径,填写全路径可以解决相对路径所造成的问题。
basedir = D:/Program Files/mysql-5.7.23-winx64
#该参数指定了 MySQL 的数据库文件放在什么路径下。数据库文件即我们常说的 MySQL data 文件。
datadir = D:/Program Files/mysql-5.7.23-winx64/data
port = 3306
server_id = …
Remove leading # to set options mainly useful for reporting servers.
The server defaults are faster for transactions and fast SELECTs.
Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 128M
sort_buffer_size = 16M
read_rnd_buffer_size = 16M
#定义应该支持的sql语法,对数据的校验等等
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
max_allowed_packet=300M
my-default.ini文件内容:
[mysqld]
character-set-server=utf8mb4
[mysql]
default-character-set=utf8mb4
sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
[mysql]
设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
设置mysql的安装目录
basedir=D:\Program Files\mysql-5.7.23-winx64
允许最大连接数
max_connections=200
服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
边栏推荐
- ES6 detailed explanation
- Introduction to Verdi Foundation
- TM1637带秒点四位LED显示器模块ARDUINO驱动程序
- 工程仪器振弦传感器无线采集仪的采集数据发送方式及在线监测系统
- Record some JS tool functions
- nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE
- emmet语法速查 syntax基本语法部分
- 安装 oh my zsh
- @5-1 CCF 2019-12-1 reporting
- Download and installation of QT 6.2
猜你喜欢

Detailed explanation of MySQL database

nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE

CCF 201509-3 template generation system

概率机器人学习笔记第二章

阿里MQTT物联网平台“云产品流转”实战——两片ESP32通过物联网平台实现远程互操作

无线振弦采集仪的使用常见问题

Mlx90640 infrared thermal imager temperature measurement module development notes (I)

Mlx90640 infrared thermal imager temperature measurement module development notes (4)

mysql历史数据补充新数据
![严重 [main] org.apache.catalina.util.LifecycleBase.handleSubClassException 初始化组件](/img/39/6f6760e80acec0b02028ea2ed1a5b1.png)
严重 [main] org.apache.catalina.util.LifecycleBase.handleSubClassException 初始化组件
随机推荐
CCF 201604-2 Tetris
广度优先遍历(图和二叉树的层序遍历相关问题)
拷贝过来老的项目变成web项目
js数字千位分割的常用方法
CCF 201509-3 template generation system
Yarn quick reference manual
【近万字干货】别让你的简历配不上你的才华——手把手教你制作最适合你的简历
Subtotal of rospy odometry sinkhole
CentOs安装redis
Probability theory and mathematical statistics 3 discrete random variables and probability distributions (Part 2)
Probabilistic robot learning notes Chapter 2
Use of dictionary tree
Terminal definition and wiring of bsp3 power monitor (power monitor)
Record some JS tool functions
Introduction to Verdi Foundation
概率论与数理统计 3 Discrete Random Variables and Probability Distributions(离散随机变量与概率分布) (下篇)
Fundamentals of C language
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.
JDBC总结
ADC introduction