ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting B
来源:互联网 发布:淘宝的瑕疵大牌化妆品 编辑:程序博客网 时间:2024/06/05 06:02
项目一直用的oracle数据库运行都正常,后来由于某种原因需要更换成MySQL,更改好配置后直接运行项目有hibernate自动建表结果看到控台日志中有个
错误:
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.
You have to change some columns to TEXT or BLOBs。
项目运行完毕后查看数据表发现有一个表没有建立,于是把建表语句拷出来,手动建表依然报错。
于是在网上搜索了好久结果发现mysql建表有个长度限制:MySQL要求一个行的定义长度不能超过65535。
(1)单个字段如果大于65535,则转换为TEXT 。
(2)单行最大限制为65535,这里不包括TEXT、BLOB。
所谓单行最大限制指的就是一张表中所有字段的所设置的长度不得超过65535字节,
例如一个表中有三个varchar字段长度30000,那么这个表的单行长度为:30000*3=90000,
大于65535则报错不能建表,这里乘以3是因为数据库用的utf8编码,3个字节表示一个字符。
解决办法:
找到原因后到回去查看entity实体代码发现这个没有建立的表中大概有一百多个字段,
而且很多string类型的字段没设置字段大小(没设置大小的情况下,默认建立varchar 255 长度),
于是乎把所有没必要设置成255长的的字段都设置小一点,改好后运行项目建表成功。
(如果你的表的中的字段长度不能改小,那就把大字段类型改成text类型,
因为单行最大限制为65535,这里不包括TEXT、BLOB。)
--本篇文章转自:http://m.blog.csdn.net/blog/dwj7758520/21563255
- ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting B
- ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting B
- ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting B
- [MySQL 错误]ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not
- [MySQL 错误]ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not
- ERROR 1118 : Row size too large. The maximum row size for the used table type
- mysql 报错:Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65
- MySQL出现The maximum row size for the used table type, not counting BLOBs, is 8126.错误
- Mysql 出现Error 1118 Row size too large. The maximum row size is 65535 的解决办法
- Row size too large
- mysql 1118 Row size too large 错误
- Row size too large (> 8126)
- Mysql_大字段问题Row size too large.....not counting BLOBs, is 8126.
- MySql “Row size too large (> 8126)”
- Mysql MySQLSyntaxErrorException Row size too large
- Mysql Row size too large (> 8126)
- [MySQL]Row size too large错误
- OpenStack Error – Index column size too large. The maximum column size is 767 bytes [Solved]
- 【Android应用开发技术:媒体开发】拍照
- Redis Java连接操作(转)
- LeetCode_3Longest Substring Without Repeating Characters
- CentOS6.5中桌面上的面板被误删后,如何正常恢复?
- JavaScript 的keydown,keypress,keyup事件
- ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting B
- 数据库之Oracle的使用【入门版,包括常用的Sql语句】
- Basic
- [java_基础]内部类和静态类
- HDU 4771 Stealing Harry Potter's Precious
- Android Do not do binder operation in destructor
- android studio生成aar包并在其他工程引用aar包
- Dancing Links hdoj 5046 3656 2295
- HDOJ 2102 A计划(bfs)