[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 near xxxx

踩坑了


数据表对应如下

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s

hiberbate 执行save:

报错:[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 near 'read, title, id) values ('这是公告内容', null, 0, '这是标题', 0)' at line 2

只提示在某一行附近出错,sql就一行,我怎么知道是在哪一个字段

解决方法:复制控制台打印得到的sql语句,放到navicat运行

出现错误是一样一样的

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s

为什么不把sql语句多个字段分行后运行查询呢,这样报错应该就会定位到某一个字段了,哈哈

看颜色应该是sql的某个关键字,字段与关键字名雷同了,就需要改字段名,然后就可以了

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL s

百度查询结果奉上:

http://dcx.sybase.com/1201/zh/dbreference/read-statement.html


相关文章: