一、问题 插入数据保存到Mysql中时, log: Preparing: INSERT INTO user ( id, name, age, email, create_time, update_time, version ) VALUES
一、问题
插入数据保存到Mysql中时,
log:
Preparing: INSERT INTO user ( id, name, age, email, create_time, update_time, version ) VALUES ( ?, ?, ?, ?, ?, ?, ? )
==> Parameters: 1628736816360296450(Long), 岳不群1(String), 70(Integer), lucy@qq.com(String), 2023-02-23 20:41:32.144(Timestamp), 2023-02-23 20:41:32.144(Timestamp), 1(Integer)
错误提示:Data truncation: Out of range value for column ‘id‘ at row 1
二、原因
@TableId(type = IdType.ID_WORKER) //mp自带策略,生成19位值,数字类型使用这种策略,比如long//@TableId(type = IdType.ID_WORKER_STR) //mp自带策略,生成19位值,字符串类型使用这种策略 private Long id;
19位数字超过int, long数据类型,改成bigint类型
或者使用自增策略,
@TableId(type=IdType.AUTO)
或者去掉tableId,自己设置id…
来源地址:https://blog.csdn.net/m0_48134027/article/details/129189816
--结束END--
本文标题: Data truncation: Out of range value for column ‘id‘ at row 1
本文链接: https://www.lsjlt.com/news/372616.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0