Error al actualizar la base de datos. Causa: java.sql.SQLException: el campo 'id' no tiene un valor predeterminado

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

Ocurrió un error al actualizar la base de datos. Razón: java.sql.SQLException: el campo "id" no tiene un valor predeterminado

solución:

ALTER TABLE 表名  MODIFY 字段名 INT  AUTO_INCREMENT;

Supongo que te gusta

Origin blog.csdn.net/weixin_45627031/article/details/112374915
Recomendado
Clasificación