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

posted @ 2019-07-29 11:22  青阳闲云  阅读(6350)  评论(0编辑  收藏  举报