### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncati

org.springframework.dao.DataIntegrityViolationException: 
### Error updating database.  Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'article_id' at row 1
### The error may exist in com/mszlu/blog/mapper/CommentMapper.java (best guess)
### The error may involve com.mszlu.blog.mapper.CommentMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO ms_comment  ( id, content, create_date, article_id, author_id, parent_id, to_uid, level )  VALUES  ( ?, ?, ?, ?, ?, ?, ?, ? )

数据库表 

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncati_第1张图片

 

错误原因

数据库设计的字段长度不够

article_id long类型的 

数据库为int型

### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncati_第2张图片

解决方法 

把数据库对应字段改成bigint

 

 

你可能感兴趣的:(mysql,数据库,mysql)