问题:

服务报错: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. jQuery Mobile Slider Widget 使用js控制

    jQuery Mobile 滑动条控件 基本用法不用多说了,看这里: http://www.runoob.com/jquerymobile/jquerymobile-form-sliders.html ...

  2. layui自定义插件citySelect 省市区三级联动选择

    省市区三级菜单联动插件 citySelect.js /** * @ name : citySelect 省市区三级选择模块 * @ Author: aggerChen * @ version: 1.0 ...

  3. 什么是blazor

    blazor是一个微软推出的基于webassembly和C#(面向对象) 以及F#(面向函数)的前端框架 它类似vue react anglar的单页前端框架 只是他不再使用js 或typescrip ...

  4. sql server if else

    DECLARE IF (@sex = '1')BEGIN PRINT '2'END ELSE BEGIN PRINT(1) END begin... end可以省略 declare @sex int ...

  5. django-Auth模块(详细介绍)

    转载自https://www.cnblogs.com/liuqingzheng/articles/9628105.html 1 Auth模块是什么 Auth模块是Django自带的用户认证模块: 我们 ...

  6. java-第三方包没有打进war包里面

    java-web的项目中引用第三方的jar包,在打成war包部署测试,出现报错,提示找不到引用的jar 解决方案: 1.在eclipse的项目--右键属性---deployment assembly- ...

  7. python 利用已有Ner模型进行数据清洗合并

    # -*- coding: utf-8 -*- from kashgari.corpus import DataReader import re from tqdm import tqdm def c ...

  8. javascript中的数据渲染与提取

    table数据 <div id="tableDiv" style="overflow-x: scroll"> <table class=&qu ...

  9. 多线程编程-- part5.1 互斥锁之公平锁-释放锁

    释放公平锁 1.unlock() unlock()在ReentrantLock.java中实现的,源码如下: public void unlock() { sync.release(1); } 说明: ...

  10. redis加入systemctl服务

    来自:https://blog.csdn.net/weixin_41114593/article/details/82383716 第一步 安装redis去官网下载最新的redis版本    安装官网 ...