一、问题

运行java代码时报如下的错误:

You have an error in your SQL syntax;Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
check the manual that corresponds to your MySQL server version for the right syntax to use near 'analyze' at line 6

二、解决

1.检查sql是否正确,大多数情况都是因为sql写错了,如果觉得sql没写错,那么很有可能是sql语句中使用了mysql的关键字和保留字段。

我这里就是因为使用 analyze 作为字段。mysql的关键字和保留字段:https://www.cnblogs.com/wuyifu/p/5949764.html

2.检查代码中传的参数是否正确

mysql报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException的更多相关文章

  1. 【mybatis】mybatis进行批量更新,报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right

    使用mybatis进行批量更新操作: 报错如下: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an erro ...

  2. Mybatis批量更新报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    批量更新数据,非常简单的一段代码,硬是报错,插入的数据也能显示出来 List<User> userlist = new ArrayList<User>(); userlist. ...

  3. 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 ...

  4. 求助:springboot调用存储过程并使用了pagehelper分页时报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

    存储过程如下: dao层的sql Controller层调用: html页面 没有使用pagehelper分页之前,可以正常使用 使用了pagehelper之后就报错 ### Error queryi ...

  5. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'dd' in 'where clause'

    今天在使用mysql数据库查找数据的时候报错,错误信息如下: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown co ...

  6. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column '??????' in 'field list'

    严重: Servlet.service() for servlet jsp threw exceptioncom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErro ...

  7. 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 ...

  8. com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test'

    com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'test' 报错原因是:MySQL数据库没有 ...

  9. 一次org.springframework.jdbc.BadSqlGrammarException ### Error querying database Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException问题排查过程

    先说结论: 因为在表设计中有一个商品描述字段被设置为desc,但desc是mysql中的关键字,如select id,name,desc,price from product;这条sql语句在查询时的 ...

随机推荐

  1. 自定义Vue组件打包、发布到npm以及使用

    本文将帮助:将自己写的Vue组件打包到npm进行代码托管,以及正常发布之后如何使用自己的组件. 本文讲述的仅仅是最基础的实现,其他复杂的操作需要非常熟悉webpack的相关知识,作者将继续学习. 先附 ...

  2. Vue.js 源码分析(六) 基础篇 计算属性 computed 属性详解

    模板内的表达式非常便利,但是设计它们的初衷是用于简单运算的.在模板中放入太多的逻辑会让模板过重且难以维护,比如: <div id="example">{{ messag ...

  3. ES新提案:双问号操作符

    摘要: 简单实用的新特性. 原文:ES新提案:双问号操作符 译者:前端小智 本文主要讲Gabriel Isenberg撰写的ES提案"Nullish coalescing for JavaS ...

  4. 类,接口,final

    继承extends 子类实例化过程: 子类中所有的构造方法默认都会访问父类中空参的构造方法 因为每一个子类的构造方法的提议行都有一条默认的语句super(); this super final修饰类, ...

  5. [Linux] 纯净ubuntu系统仓库更换为阿里云的源

    1.先apt-get update一下当前默认的源,更新完成后先把vim命令安装一下,再修改源仓库为阿里云,否则无法直接编辑文件 2.先添加阿里云的源,编辑文件/etc/apt/sources.lis ...

  6. spark 基础

    scala版 ,基本名词概念及 rdd的基本创建及使用 var conf = new SparkConf() var sc: SparkContext = new SparkContext(conf) ...

  7. Centos 7 编译安装mariadb 5.5

    一.环境 OS :Linux 3.10.0-693.el7.x86_64 mariadb下载地址: ]# wget https://downloads.mariadb.org/interstitial ...

  8. TransportFireWall

    1.shadow for python install on windows (1.) install python pip (2.) install openssl for windows (3.) ...

  9. eclipse 错误日志地址

    我们用eclipse插件的时候,有时插件会报错误,那么这些错误日志在哪儿放着呢? 这些错误日志的存放位置是:“你的workspace名称\.metadata\.log”,如果我们的eclipse报错了 ...

  10. maven 常见命令

    mvn clean package依次执行了clean.resources.compile.testResources.testCompile.test.jar(打包)等7个阶段.mvn clean ...