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 for the right syntax to use near

MyBatis中踩到的坑!中文空格!!!

事情大概是这样的,我需要一个查询语句,然后调用Mapper的时候提示Sql语法错误

最后通过一张图发现了问题的根本原因!!!版本提交前后对比!!!这是xml里面的SQL语句

  1. 我发现唯一的区别就是上面红色框中有改动!所以我认为中文空格会导致sql语法错误
  2. 然后我去MySQL数据库测试了一下果然会报错!!!
    吃西瓜不吐西瓜皮!!!

猜你喜欢

转载自blog.csdn.net/qq_42380700/article/details/84852865
今日推荐