解决:You have an error in your SQL syntax; check the manual that corresponds to your MySQL
错误信息为:
check the manual that corresponds to your MySQL server version for the right syntax
这是之前写的一条 Mysql语句报的 SQL错误,但是仔细检查 SQL语句没有发现有什么异常问题。
他会提示你再Mapper中的哪句sql语句的周围有语法错误
解决方法有两个:
1.在数据库表冲突字段前后加 `符号(Tab键上面那个键),就不会再报语法错误了;
2.修改数据库表中冲突字段名称,修改为和 SQL语句关键字不冲突的其他名称
看了一个小时,发现是自己的列名之间有空格,因为懒得写,复制过来,使用回车是没有影响的
<insert id="insert" useGeneratedKeys="true" keyProperty="uid" > INSERT INTO t_user(username , password , salt , phone , email , gender , avatar ,is_delete , created_user , created_time , modified_user , modified_time ) values ( #{username} , #{password} , #{salt} , #{phone} , #{email} , #{gender} , #{avatar} ,#{isDelete} , #{createdUser} , #{createdTime} , #{modifiedUser} , #{modifiedTime} ) </insert>