I am trying to insert a very long text string into a MySQL Blob column, but MySQL is only saving 64kB of the data. The string is 75360 characters long. I am connecting with PHP's mysql_connect()
.
Any ideas?
Does it make a difference if it's Blob or Text. I originally had it as a Text but changed it with no affect.
TEXT: 65,535 characters - 64 KB The standard TEXT data object is sufficiently capable of handling typical long-form text content. TEXT data objects top out at 64 KB (expressed as 2^16 -1) or 65,535 characters and requires a 2 byte overhead.
LONGTEXT. Holds a string with a maximum length of 4,294,967,295 characters. LONGBLOB. For BLOBs (Binary Large Objects). Holds up to 4,294,967,295 bytes of data.
MySQL stores each database (also called a schema) as a subdirectory of its data directory in the underlying filesystem. When you create a table, MySQL stores the table definition in a . frm file with the same name as the table. Thus, when you create a table named MyTable , MySQL stores the table definition in MyTable.
VARCHAR(size) Holds up to 255 characters and allows a variable length string.
Because that's the maximum size of a BLOB column. You need to use MEDIUMBLOB/LONGBLOB or MEDIUMTEXT/LONGTEXT.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With