Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is only 64kB of data being saved in my MySQL data column?

Tags:

text

php

mysql

blob

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.

like image 634
Darryl Hein Avatar asked Jan 03 '09 20:01

Darryl Hein


People also ask

What is the maximum size of characters stored in a field declared with the TEXT data type?

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.

What is long data type in MySQL?

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.

How is data stored in MySQL?

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.

Which of the following data types does require you to provide character length to store the values in MySQL?

VARCHAR(size) Holds up to 255 characters and allows a variable length string.


1 Answers

Because that's the maximum size of a BLOB column. You need to use MEDIUMBLOB/LONGBLOB or MEDIUMTEXT/LONGTEXT.

like image 94
Dan Dyer Avatar answered Sep 21 '22 15:09

Dan Dyer