mysql 我定义了一个字段为 varchar(255)我想把长度改的大一点,怎么弄(是用varchar不换成其他的类型)??看过好多文章说是 utf-8 的改为varchar(21845),但提出警告#1118 - 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 我定义了一个字段为 varchar(255)我想把长度改的大一点,怎么弄(是用varchar不换成其他的类型)??看过好多文章说是 utf-8 的改为varchar(21845),但提出警告#1118 - 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


相似考题
参考答案和解析
VARCHAR的最大实际长度由最长的行的大小和使用的字符集确定。最大有效长度是65,532字节如果UNICODE字符由2个字节表示,则编码成UTF-8很可能需要3个字节varchar(21845) 里面 21845 * 3 = 65535. 超过了 65532字节的上限。
参考资料:http://baike.baidu.com/view/25412.htm


希望能帮到你,别忘了采纳我的答案哦,祝你生活愉快!