1. 程式人生 > >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

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資料庫測試了一下果然會報錯!!!

    吃西瓜不吐西瓜皮!!!