时间:2021-01-10来源:www.pcxitongcheng.com作者:电脑系统城
sql语句中词和mysql的关键字冲突了,用 `` (tab键上方)将词括起来就好了。
1 2 3 4 5 6 7 |
< insert id= "insert" parameterType= "com.zhangman.manman.entity.User" > insert into user (id, username, password , name , desc ,email,birthday,phone,status,createtime,roleId) values (#{id,jdbcType= INTEGER }, #{username,jdbcType= VARCHAR }, #{ password ,jdbcType= VARCHAR }, #{ name ,jdbcType= VARCHAR }, #{ desc ,jdbcType= VARCHAR }, #{email,jdbcType= VARCHAR }, #{birthday,jdbcType= VARCHAR }, #{phone,jdbcType= VARCHAR }, #{status,jdbcType= INTEGER }, #{createtime,jdbcType= DATE }, #{roleid,jdbcType= INTEGER }) </ insert > |
1 2 3 4 5 6 7 |
< insert id= "insert" parameterType= "com.zhangman.manman.entity.User" > INSERT INTO ` user ` (username, ` password `,` name `,` desc `,email,birthday,phone,`status`,createtime,roleId) VALUES (#{username}, #{ password },#{ name }, #{ desc },#{email}, #{birthday}, #{phone}, #{status}, #{createtime}, #{roleid}) </ insert > |
补充:MySql ERROR 1064 (42000)同样的错误,不一样的解决方法
开始时代码是这样:
然后运行:
代码根本毫无错误,但为什么会出错呢?在我花了2个小时后终于知道了答案。
我没有加分号!!!!!
修改后代码:
然后再次运行后:
再一次为自己的无知和粗心感到绝望!!!
2020-12-07
Navicat Premium远程连接MySQL数据库的方法2020-12-07
MySQL binlog_ignore_db 参数的具体使用2020-12-07
Mysql 5.6 "隐式转换"导致的索引失效和数据不准确的问题mysql 8.0.22 下载安装配置方法图文教程,文中安装步骤介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...
2020-11-27