返回顶部
首页 > 资讯 > 数据库 >ShardingSphere修改报错-MysqlDataTruncation: Data truncation: Out of range value for column ‘xx‘ at row 1
  • 526
分享到

ShardingSphere修改报错-MysqlDataTruncation: Data truncation: Out of range value for column ‘xx‘ at row 1

javasql后端 2023-12-23 11:12:43 526人浏览 薄情痞子
摘要

目录 一、场景二、报错信息三、原因四、解决 一、场景 项目使用ShardingJDBC操作数据库 修改sql执行报错 二、报错信息 ### Error updating database. Cause: com.Mys


一、场景

项目使用ShardingJDBC操作数据库

修改sql执行报错


二、报错信息

### Error updating database.  Cause: com.Mysql.cj.jdbc.exceptions.mysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1### The error may involve com.xxx.mapper.service.KeyWordMapper.updateByExample-Inline### The error occurred while setting parameters### SQL: UPDATE t_wx_keyword  SET keyword = ?,msgType = ?,msgId = ?,content = ?,createTime = ?,eable = ?,matchType = ?,originId = ?,vdnId = ? WHERE (       (  vdnId = ?                    and originId = ?                    and id = ? ) )### Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1; Data truncation: Out of range value for column 'MSGID' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1org.springframework.dao.DataintegrityViolationException: ### Error updating database.  Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1### The error may involve com.xxx.mapper.service.KeyWordMapper.updateByExample-Inline### The error occurred while setting parameters### SQL: UPDATE t_wx_keyword  SET keyword = ?,msgType = ?,msgId = ?,content = ?,createTime = ?,eable = ?,matchType = ?,originId = ?,vdnId = ? WHERE (       (  vdnId = ?                    and originId = ?                    and id = ? ) )### Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1; Data truncation: Out of range value for column 'MSGID' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Out of range value for column 'MSGID' at row 1

三、原因

表字段的数据类型与实体类属性的类型不一致

在本例中:表字段MSGID的数据类型是int,而实体类的msgId属性类型是String,类型不一致


四、解决

方法1、更改表字段数据类型,与实体类属性类型一致

方法2、更改实体类属性类型,与表字段数据类型一致

来源地址:https://blog.csdn.net/weixin_52116015/article/details/130739559

您可能感兴趣的文档:

--结束END--

本文标题: ShardingSphere修改报错-MysqlDataTruncation: Data truncation: Out of range value for column ‘xx‘ at row 1

本文链接: https://lsjlt.com/news/551627.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作