已完美解决java.sql.SQLException: Data truncated for column ‘id‘ at row 1

2022-07-11 15:31:39 浏览数 (1)

一、起因

小编是因为在插入一条数据到mysql中,采用Mybatis-plus自动生成id长度超过了数据库的长度导致报错了,报错信息如下

代码语言:javascript复制
Cause: java.sql.SQLException: Data truncated for column 'id' at row 1; 
Data truncated for column 'id' at row 1; nested exception is java.sql.SQLException: Data truncated for column 'id' at row 1] with root cause

java.sql.SQLException: Data truncated for column 'id' at row 1

二、解决方案

Q.E.D.

0 人点赞