万能方法解决—You have an error in your SQL syntax
程序员文章站
2022-03-10 15:40:19
万能方法解决——You have an error in your SQL syntax问题分析显而易见,肯定是你的SQL语句在执行的时候出现了语法错误第一步在xml文件中配置以下内容来启动MyBatis的debug模式:logging: level: com.chat.mapper: debug #这里修改成你们自己mapper类的包路径做好上面步骤之后,重启服务,再次进行测试,然后就可以在控制台看到执行的SQL语句了,下面是示例:第二步知道SQL语...
万能方法解决——You have an error in your SQL syntax
问题分析
显而易见,肯定是你的SQL语句在执行的时候出现了语法错误
第一步
在xml文件中配置以下内容来启动MyBatis的debug模式:
logging:
level:
com.chat.mapper: debug #这里修改成你们自己mapper类的包路径
做好上面步骤之后,重启服务,再次进行测试,然后就可以在控制台看到执行的SQL语句了,下面是示例:
第二步
知道SQL语句之后,就可以进行分析啦,比如用用MySql执行一下等方式,大的来说有以下几种情况:
1、基本句法错误
2、表名或者字段名与SQL中的关键词同名
3、参数传入时未加 '(单引号)
4、..........
第三步
经过上面两步,想必大家都知道自己的问题出在哪里了,接下来就是对症下药即可
本文地址:https://blog.csdn.net/weixin_44829930/article/details/110607721
上一篇: 升级宽带到500M光纤
下一篇: 三分钟学会 Java枚举
推荐阅读
-
pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co
-
mybatis java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax;
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
MySql-You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v
-
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
-
Mysql错误:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use