You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
程序员文章站
2022-07-14 10:25:25
...
在插入数据的时候出现这种类型的错误 ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper:146 - 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 'signal, src_id, upt_time) 多半是有一个字段是数据库的关键字,所以我们在命名的时候不要用带有关键字的字符作为数据库的字段。 解决方案有几种,如果是自己写的sql的话可以在关键字上面加一个符号 · (Tab键上面的符号【英文状态下】),sql语句如下:
insert into signal_tbl (comment_count, point, praise_count, price, share_count, sign_type, `signal`, src_id, upt_time) values (0, 0, 0, '12345', 0, 0, 0, 123, '2018-05-11')
如果用的hibernate集成的话,可以使用注解的方式,在实体类上面
@Column(name = "\"signal\"",columnDefinition = "tinyint")
public int getSignal() {
return signal;
}
上一篇: Spring测试静态方法打桩-PowerMockito及SpringBootTest结合使用
下一篇: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
推荐阅读
-
pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co
-
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
-
check the manual that corresponds to your MySQL server version for the right syntax的错误解析,correspondssyntax