### 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 ( ?, ?, ?, ?, ?, ?, ?, ? )
数据库表

错误原因
数据库设计的字段长度不够
article_id long类型的
数据库为int型

解决方法
把数据库对应字段改成bigint
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)