关于mysql varchar 类型的最大长度限制

 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

今天修改字段类型(打算增加某个字段varchar的长度)时遇到这么一个错误。

症结在于这个表的字段比较多,varchar类型的所有长度超过了限制。数据库采用utf-8编码,varchar(N)中N的总和不能大于 (65535-1-2-4-30*3)/3=21812 这个值。粗略估计已经超了。

解决方法是将需要扩大的这个字段改成text类型。

原文地址:https://www.cnblogs.com/yangcclg/p/5344052.html