欢迎投稿

今日深度:

mysql报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException,

mysql报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException,


一、问题

 运行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.检查代码中传的参数是否正确

www.htsjk.Com true http://www.htsjk.com/Mysql/30255.html NewsArticle mysql报错com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException, 一、问题 运行java代码时报如下的错误: You have an error in your SQL syntax;Cause:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: check the ma...
相关文章
    暂无相关文章
评论暂时关闭