当前位置: 代码迷 >> 综合 >> bug -表名用了sql保留字反引号解决mybatis ySQL server version for the right syntax to use near a
  详细解决方案

bug -表名用了sql保留字反引号解决mybatis ySQL server version for the right syntax to use near a

热度:2   发布时间:2023-12-13 22:09:57.0

错误:

mybatis ySQL server version for the right syntax to use near a
其实就是写了挺正确的插入语句但是报错

原因

我的表名是key,和mysql的保留字重复了,用反引号括起来

解决:用键盘左上角的顿号写表名字

 @Insert("insert into `key` values (#{name},#{key})")
  相关解决方案