Error updating database. Cause: java.sql.SQLException: Field ‘id‘ doesn‘t have a default value
org.apache.ibatis.exceptions.PersistenceException:### Error updating database.Cause: java.sql.SQLException: Field 'id' doesn't have a default value### The error may involve com.fanlan.Dao.blogDao.add1
·
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: Field 'id' doesn't have a default value
### The error may involve com.fanlan.Dao.blogDao.add1-Inline
### The error occurred while setting parameters
### SQL: insert into blog (title,author,create_time,views) values (?,?,?,?)
### Cause: java.sql.SQLException: Field 'id' doesn't have a default value
更新数据库时出错。原因:java.sql.SQLException异常:字段“id”没有默认值
解决方案:
ALTER TABLE 表名 MODIFY 字段名 INT AUTO_INCREMENT;
更多推荐
已为社区贡献1条内容
所有评论(0)