插入数据库 出现 Data truncation: Out of range value adjusted for column 'id'....的问题
来源:互联网 发布:淘宝儿童模特拍照 编辑:程序博客网 时间:2024/05/01 03:16
昨天一张MYSQL表里id设置一个bigint类型20位的主键,以便存储一个crc64(自己的20位int)的结果,但是这时候出现了一个问题
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value adjusted for column 'id' at row 1
表面上看好像是长度太长,当我减少一位生成的crc后也确实可以插入表里,但是我设置的就是20位的bigint啊,为什么会出现这个情况?
错误的原因:不是因为数据太长,而是因为在数据库中设置的类型是unsigned无符号类型的。(具体原因:无符号整型和有符号整型的区别就是无符号类型可以存放的正数范围比有符号整型中的范围大一倍,因为有符号类型将最高位储存符号,而无符号类型全都储存数字。)
嗯,就是这样!
0 0
- 插入数据库 出现 Data truncation: Out of range value adjusted for column 'id'....的问题
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value adjusted for column 'price'
- #1264 - Out of range value adjusted for column 'ID 【转】
- Out of range value adjusted for column
- Data truncation: Out of range value for column 'ID' at row 2
- Exception:Data truncation: Out of range value for column 'phone' at row 1异常问题
- #1264 - Out of range value adjusted for column 'ID' at row 1
- MySQL5错误 #1264 "Out of range value adjusted for column ..."
- MySQL错误"Out of range value adjusted for column ..."的解决方法
- MySQL错误 Out of range value adjusted for column的解决方法
- MySQL错误"Out of range value adjusted for column ..."的解决方法
- MySQL错误"Out of range value adjusted for column ..."的解决方法
- Data truncation: Out of range value for column '列名' at row 1
- Data truncation: Out of range value
- [MySQL学习]STRICT_ALL_TABLES对应的OUT of RANGE VALUE FOR COLUMN和DATA truncated FOR COLUMN
- mysql报错:out of range value for column问题
- 关于Data truncation: Incorrect string value: '' for column 问题的解决办法
- Out of range value for column 'probationMoney' at row 1
- Android - SharedPreferences的用法
- 自定义View的使用(一)
- 在CentOS下用yum命令安装mysql
- TOmcat启动后报:IOException while loading persisted sessions: java.io.EOFException错误
- Manjaro linux软件源设置
- 插入数据库 出现 Data truncation: Out of range value adjusted for column 'id'....的问题
- 谁在说谎
- 内存管理——ios工程图片资源
- Android开发经验总结
- Android开发经验总结
- 使用Simple-Spring-Memcached注解做缓存操作
- TabControl控件学习
- cocos中Action的基本使用
- UIAlertController点击背景回收弹窗的问题