根据 MySQL 文档,有四种 TEXT 类型:
假设字符编码为 UTF-8,我可以在每种数据类型的列中存储的最大长度是多少?
来自 文档 (MySQL 8) :
<前>类型 |最大长度-----------+------------------------------------小文字 |255 (2 8−1) 字节正文 |65,535 (216−1) 字节 = 64 KiB中文本 |16,777,215 (224−1) 字节 = 16 MiB长文 |4,294,967,295 (232−1) 字节 = 4 GiB请注意,列中可以存储的字符数量取决于字符编码.
Per the MySQL docs, there are four TEXT types:
What is the maximum length that I can store in a column of each data type assuming the character encoding is UTF-8?
From the documentation (MySQL 8) :
Type | Maximum length -----------+------------------------------------- TINYTEXT | 255 (2 8−1) bytes TEXT | 65,535 (216−1) bytes = 64 KiB MEDIUMTEXT | 16,777,215 (224−1) bytes = 16 MiB LONGTEXT | 4,294,967,295 (232−1) bytes = 4 GiB
Note that the number of characters that can be stored in your column will depend on the character encoding.
这篇关于TINYTEXT、TEXT、MEDIUMTEXT 和 LONGTEXT 最大存储大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!