TEXT BOLB
类型 | 大小 |
---|---|
TINYBLOB TINYTEXT | 2^8 |
BLOB TEXT | 2^16 |
MEDIUMBLOB MEDIUMTEXT | 2^24 |
LONGBLOB LONGTEXT | 2^32 |
- 上表的单位是字节,其中在utf8下面,每个汉字占用3个字节,不同编码下,汉字占用的字节数不通
- mysql的行大小限制在65535个字节,所以如果使用varchar是受到这个限制的,也就是说随着表字段的增多,varchar单个字段可使用的字节数必然是越来越小的,所以如果想存储更多的字符串,应当使用TEXT类型.[官网原文](https://dev.mysql.com/doc/refman
/5.7/en/column-count-limit.html):The internal representation of a
MySQL table has a maximum row size limit of 65,535 bytes, even if the storage engine is capable of supporting larger rows. BLOB and TEXT columns only contribute 9 to 12 bytes toward the row size limit because their contents are stored separately from the rest of the row.