Error updating database. Cause: java.sql.SQLException: Field 'id' doesn't have a default value

Springboot 通过mybatis使用数据库,xml文件如下:


	    insert into t_user(user_name, note) values( #{userName}, #{note})

报如标题错误。

原因: mysql中对应的表的id字段没有设置自增长。

你可能感兴趣的:(springboot)