java.sql.SQLException: Field 'id' doesn't have a default value

Mybatis向MySQL插入数据时一直报错
java.sql.SQLException: Field ‘id’ doesn’t have a default value

解决方法:
打开Navicat,将主键id设置为自增即可,勾选后保存
java.sql.SQLException: Field 'id' doesn't have a default value_第1张图片

你可能感兴趣的:(java.sql.SQLException: Field 'id' doesn't have a default value)