O MySQL pode manipular uma cadeia de 2 milhões de caracteres em BLOB?
O tamanho máximo de um BLOB
é 65535
bytes.
No entanto, se você deseja armazenar valores maiores, você pode usar um MEDIUMBLOB
( 16,777,215
bytes) ou um LONGBLOB
( 4G
bytes).
Nota:
- Ao usar um conjunto de caracteres Unicode, nem todos os caracteres usam o mesmo número de bytes e podem exigir até três (quatro) bytes por caractere.
No entanto:
The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers.
UTF-8 é o que eu vou colocar lá
The utf8 character set is the same in MySQL 5.7 as before 5.7 and has exactly the same characteristics:
No support for supplementary characters (BMP characters only).
A maximum of three bytes per multibyte character.
O que é um BLOB?
A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. These differ only in the maximum length of the values they can hold. The four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These correspond to the four BLOB types and have the same maximum lengths and storage requirements. See Section 11.7, “Data Type Storage Requirements”
...
The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers. You can change the message buffer size by changing the value of the max_allowed_packet variable, but you must do so for both the server and your client program.
Fonte 11.4.3 Os tipos BLOB e TEXT :
Requisitos de armazenamento para tipos de string
In the following table, M represents the declared column length in characters for nonbinary string types and bytes for binary string types. L represents the actual length in bytes of a given string value.
...
This page lists the BLOB and TEXT types and gives a formula for calculating the storage required, but it does not give the different maximum sizes. Here they are:
- TINYTEXT - 255 bytes
- TEXT - 65535 bytes
- MEDIUMTEXT - 16,777,215 bytes (2^24 - 1)
LONGTEXT - 4G bytes (2^32 – 1)
TINYBLOB - 255 bytes
- BLOB - 65535 bytes
- MEDIUMBLOB - 16,777,215 bytes (2^24 - 1)
- LONGBLOB - 4G bytes (2^32 – 1)
Fonte Seção 11.7 Requisitos de armazenamento de tipo de dados :