问题:

服务报错:incompatible with sql_mode=only_full_group_by,如下图所示:

分析:

NLY_FULL_GROUP_BY是MySQL提供的一个sql_mode,通过这个sql_mode来提供SQL语句GROUP BY合法性的检查。各种精确查询会报错

解决方案:

1. 执行以下sql,关闭ONLY_FULL_GROUP_BY(这种方式在重启mysql后会失效)

set @@GLOBAL.sql_mode='';

set sql_mode ='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

2. 修改/etc/my.cnf(重启后仍然生效)

在mysqld下添加: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服务,OK!

3. 查看sql_model参数:

SELECT @@GLOBAL.sql_mode;
SELECT @@SESSION.sql_mode;

mysql报错处理:incompatible with sql_mode=only_full_group_by的更多相关文章

  1. mysql下this is incompatible with sql_mode=only_full_group_by解决方案

    本地测试没有问题,部署到客户服务器之后报如下错误: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #1 o ...

  2. this is incompatible with sql_mode=only_full_group_by

    mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by - Jim_.NET - 博客园 http://www.c ...

  3. mysql命令gruop by报错this is incompatible with sql_mode=only_full_group_by

    在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause ...

  4. mysql报错this is incompatible with sql_mode=only_full_group_by

    1.报错信息 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: In aggregated query without GROUP ...

  5. mysql(5.7以上)查询报错:ORDER BY clause is not in GROUP BY..this is incompatible with sql_mode=only_full_group_by

    执行mysql命令查询时: select * from table_name错误信息如: [Err] 1055 - Expression #1 of ORDER BY clause is not in ...

  6. 5.7版本mysql查询报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:...this is incompatible with sql_mode=only_full_group_by

    先瞧下日志: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException ...

  7. Mysql插入数据时,报错this is incompatible with sql_mode=only_full_group_by

    Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'inform ...

  8. mysql5.7 gruop by报错this is incompatible with sql_mode=only_full_group_by

    解析:在mysql 工具 搜索或者插入数据时报下面错误: ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY cla ...

  9. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: ..... this is incompatible with sql_mode=only_full_group_by

    一.异常信息 org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysq ...

随机推荐

  1. liunx 安装rsync

    新建一个rsync.s文件,把下面的代码写入文件里: #!/usr/bin/env bash mkdir -p /data/app/rsync/etc/ mkdir -p /data/logs/rsy ...

  2. HTML5自学2

    1.1   文字格式 一个杂乱无序.堆砌而成的网页,会让人感觉枯无味,而一个美观大方的网页,会让人有美轮美奂,流连忘返的感觉,本节将介绍如何设置网页文本格式. 文字格式包括字体.字号.文字颜色.字体风 ...

  3. python PEP8常用规范(看完你会感谢我的!)

    完整的规范移步传送门 pep8规范 官方文档:[https://www.python.org/dev/peps/pep-0008/](https://www.python.org/dev/peps/p ...

  4. JVM内存模型入门

    JVM内存模型入门 本文是学习笔记,原文地址在:https://www.bilibili.com/video/av62009886 综述 其实没有太多新东西 JVM主要分为五个区域:栈区.堆区.本地方 ...

  5. Python(os和sys)理解

    Python(os和sys)理解 os模块负责程序与操作系统的交互,提供了访问操作系统底层的接口; sys模块负责程序与python解释器的交互,提供了一系列的函数和变量,用于操控python的运行时 ...

  6. 学习.NET中的AppDomain

    学习.NET中的AppDomain 什么是AppDomain?AppDomain是一组程序集的逻辑容器,AppDomain是为了提供隔离而设计的.它提供了保护.配置和终止其中每一个应用程序的隔离 Ap ...

  7. dedecms织梦副栏目名称和链接调用

    https://blog.csdn.net/qq_41805834/article/details/79552859

  8. Linux添加虚拟网卡的多种方法

    Linux添加虚拟网卡的多种方法有时候,一台服务器需要设置多个ip,但又不想添加多块网卡,那就需要设置虚拟网卡.这里介绍几种方式在linux服务器上添加虚拟网卡. 我们向eth0中添加一块虚拟网卡: ...

  9. springmvc视图文件的保护

    可以将视图文件,包含视图文件的目录放在WEB-INF下,WEB-INF是受保护的,放在该目录下,就只能在代码中访问到了view文件了,用户无法通过浏览器直接输入地址访问.

  10. CTF基本常识

    参照百度百科: https://baike.baidu.com/item/Pwn/5321286?fr=aladdin ”Pwn”是一个黑客语法的俚语词 [1]  ,是指攻破设备或者系统 [2]  . ...