SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法

这篇具有很好参考价值的文章主要介绍了SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

一、原理层面
这个错误发生在mysql 5.7.5 版本及以上版本会出现的问题:
mysql 5.7.5版本以上默认的sql配置是:sql_mode=“ONLY_FULL_GROUP_BY”,这个配置严格执行了"SQL92标准"。
很多从5.6升级到5.7时,为了语法兼容,大部分都会选择调整sql_mode,使其保持跟5.6一致,为了尽量兼容程序。
二、sql层面
在sql执行时,出现该原因,简单来说就是:
由于开启了ONLY_FULL_GROUP_BY的设置,如果select 的字段不在 group by 中,
并且select 的字段未使用聚合函数(SUM,AVG,MAX,MIN等)的话,那么这条sql查询是被mysql认为非法的,会报错误…
解决方法:

在Windows在修改配置文件

找到MySQL安装目录,并用编辑器打开,我这边用的notepad++

SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法,sql,数据库

编辑my.ini文件,在[mysql]标签下

这是原来的sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"

去掉前面的ONLY_FULL_GROUP_BY,

保存文件

SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法,sql,数据库

再底部右键打开任务管理器,选择服务,找到MySQL80,停止服务,再次开启服务

SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法,sql,数据库

重新执行SQL语句,就可执行成功了

SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法,sql,数据库文章来源地址https://www.toymoban.com/news/detail-813019.html

到了这里,关于SQL语句错误this is incompatible with sql_mode=only_full_group_by解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • 关于yarn安装时报“node“ is incompatible with this module的解决办法

    关于yarn安装时报“node“ is incompatible with this module的解决办法

    在用vue写一个h5页面时,当在用yarn安装时,提示如下错误: The engine “node” is incompatible with this module. Expected version \\\"^14.18.0 || ^16.14.0 || =18. 我是使用命令忽略错误: 然后再安装即可以成功: 安装完之后项目可以正常启动了

    2024年02月10日
    浏览(8)
  • The engine “node“ is incompatible with this module. Expected version

    The engine “node“ is incompatible with this module. Expected version

    vue项目用了yarn,yarn install后报错如下: ** ** 执行: 然后yarn install后成功。 在此记录问题,如有需要修改的地方,还请不吝赐教。

    2024年02月12日
    浏览(10)
  • The engine “node“ is incompatible with this module. Expected version 问题解决办法

    The engine “node“ is incompatible with this module. Expected version 问题解决办法

    安装一个组件库总是报错: 手动右键删除 node_modules 文件夹,清空了 npm 缓存: 发现还是不行。 后来在网上找到了解决方案:忽略错误。 终端输入命令: 再重新安装依赖,运行项目就可以了:

    2024年02月12日
    浏览(9)
  • Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.

    Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time.

    项目概述:  问题解决: 步骤一:在关联的两个模块zx-gateway-0829和zx-common-0829中寻找 spring-boot-starter-web  步骤二:删除gateway模块pom.xml中关联的commont模块,将common中gateway所需要的工具复制一份到gateway模块对应位置下。 嗨喽,CSDN的友友们,今天启动网关Gateway时发现了一个不兼

    2023年04月26日
    浏览(20)
  • Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway错误

    Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway错误

      原因是因为spring cloud gateway 是建立在spring boot 2.x 和 spring webflux基础上的既:gateway 本身已经包含了spring mvc 的功能,正与提示的一样和spring boot 的web starter冲突了 找到gateway下面的spring-boot-starter-web依赖,然后 将其注释掉  

    2024年02月15日
    浏览(9)
  • error @achrinza/node-ipc@9.2.5: The engine “node“ is incompatible with this module. 解决node.js版本不兼容问题

    error @achrinza/node-ipc@9.2.5: The engine “node“ is incompatible with this module. 解决node.js版本不兼容问题

    目录 很多人运行项目的时候会出现报错信息: 解决方案 然后再次运行就好了: 此时,我点击链接就可以看到了: 很多人运行项目的时候会出现 报错信息: 这个错误是因为你的项目中使用了一个模块 @achrinza/node-ipc,它要求 Node.js 版本在 8 到 18 之间,但你的 Node.js 版本是

    2024年03月27日
    浏览(11)
  • 【错误记录】Android 编译报错 ( The project uses Gradle version which is incompatible with Android Studio )

    【错误记录】Android 编译报错 ( The project uses Gradle version which is incompatible with Android Studio )

    报错信息 : 使用的 ijkplayer 版本是 0.8.8 版本的 , 这是 2018 年的版本 , 生成的 Android Studio 工程源码 也是 在 2018 年运行的 , 当时使用 的 Android Studio 版本 , Gradle 构建工具版本 , Android Gradle 插件版本 , 与当前差异很大 ; 上述 构建工具 , AS 开发环境 , AGP 插件 , 版本对应关系可以参

    2024年02月08日
    浏览(10)
  • MySQL错误sql_mode=only_full_group_by完美解决方案

    MySQL错误sql_mode=only_full_group_by完美解决方案

    mysql是高版本,当执行group by时,select的字段不属于group by的字段的话,sql语句就会报错。 错误提示:this is incompatible with sql_mode=only_full_group_by 1.查询数据库版本: SELECT VERSION(); 2.查看sql_mode的语句: select @@GLOBAL.sql_mode; 3.临时解决方案: 去掉ONLY_FULL_GROUP_BY,重新设置值。 SET

    2023年04月09日
    浏览(10)
  • OpenCV 中的错误信息 “Layout of the output array img is incompatible with cv::Mat (step...

    OpenCV 中的错误信息 “Layout of the output array img is incompatible with cv::Mat (step[ndims-1] !)” 表示输出数组 img 的布局与 cv::Mat 类型不兼容。这种错误通常是在使用 OpenCV 进行图像处理时出现的,可能是由于输入和输出 Mat 类的尺寸不匹配、步长不符合要求等原因导致的。 为了更好地理

    2024年02月16日
    浏览(10)
  • SQL常用语法( WITH 语句)

    在这里插入代码片— 个人笔记: 努力奋斗-Li亚Q 个人笔记: 努力奋斗-Li亚Q WITH语句是一种在SQL中常用的语法,用于创建临时表或视图,以便在后续的查询中使用。它可以简化复杂查询的编写,并提高查询性能。以下是一些WITH语句的示例: 这个WITH语句创建了一个名为temp_ta

    2024年02月09日
    浏览(8)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包