mysql支持很多类型,不同的文本有不同的长度限制。可以根据实际需要进行选择。
TINYBLOB, TINYTEXT L + 1 bytes, where L < 2^8 (255 Bytes)
BLOB, TEXT L + 2 bytes, where L < 2^16 (64 Kilobytes)
MEDIUMBLOB, MEDIUMTEXT L + 3 bytes, where L < 2^24 (16 Megabytes)
LONGBLOB, LONGTEXT L + 4 bytes, where L < 2^32 (4 Gigabytes)
See for maximum numbers: MySQL :: MySQL 8.0 Reference Manual :: 11.7 Data Type Storage Requirementshttp://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
参考:
https://stackoverflow.com/questions/6766781/maximum-length-for-mysql-type-text