标签:mysq 目录 color highlight 设置mysql each pre date 重启
SELECT c.TNAME FROM score a,course b,teacher c WHERE a.CNO=b.CNO AND b.TNO=c.TNO GROUP BY a.CNO HAVING COUNT(a.CNO)>5
错误:error : Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘billing.view_dat_sdr_201903.source‘ which is not functily dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
查询后发现是因为“sql_mode=only_full_group_by”导致出错
1、通过cmd更改sql_mode
set global sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION‘;
重启后还是会恢复
2、更改配置文件my.ini
原安装文件里没有,自己在根目录下新建
[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=D:\mysql\mysql-8.0.11-winx64 # 设置mysql数据库的数据的存放目录 datadir=D:\mysql\mysql-8.0.11-winx64/data # 允许最大连接数 max_connections=200 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 sql_mode=‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION‘
重启依然有效。OK!
标签:mysq 目录 color highlight 设置mysql each pre date 重启
原文地址:https://www.cnblogs.com/soberkkk/p/12547586.html