当前位置:Gxlcms > 
数据库问题 > 
mysql8 安装无my.ini配置文件和执行groupBy报错修改sql_mode不生效的解决方案
                     
                    
                        mysql8 安装无my.ini配置文件和执行groupBy报错修改sql_mode不生效的解决方案
                        
                            时间:2021-07-01 10:21:17
                            帮助过:40人阅读
							                        
                     
                    
                    
                    //dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the
# *** 
default location during install, and will be replaced 
if you
# ***
 upgrade to a newer version of MySQL.
[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.
basedir = E:\mysql-8.0.21-
winx64
datadir = E:\mysql-8.0.21-
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_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
 
 
 
2.报错[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘information_schema.PROFILING.SEQ‘ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
1)网上的解决方案都是修改sql_mode 但是因为我的my.ini没有这个文件,怎么改都不生效,如果您也遇到同样的问题记得先把第一步操作了,重新启动mysq
2)在添加my.ini文件的时候就把sql_mode参数添加进去
3)该方法若mysql重启则失效
mysql中执行 show variables like ‘%sql_mode‘;
set @@GLOBAL.sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION‘;
mysql8 安装无my.ini配置文件和执行groupBy报错修改sql_mode不生效的解决方案
标签:needed   文件   遇到的问题   global   hang   most   import   imp   结果