标签:mct sch 成功 div centos7 ted -o roc image
基本信息:数据库表结构如下:
对MySql进行操作时报以下错误:
[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
一次性解决方案:
select @@sql_mode
复制查询出来的信息:
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
windwos环境下,直接修改默认my.ini(解压缩版)或其他默认配置文件即可
[root@VM_18_167_centos ~]# vi /etc/my.cnf
复制查询到的sql_mode配置信息,并去掉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
设置sql_mode内容如下:
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:
systemctl restart mysqld
再次执行插入语句,我们可以看到已经成功操作,不再报错了
标签:mct sch 成功 div centos7 ted -o roc image
原文地址:https://blog.51cto.com/1197822/2363459