I have been up-loading images into the MySQL database using a routine that I wrote. I have two tables. imagemetadata holds all the metadata and imagedata holds all the images. Currently Imagemetadata has 9791 images with 1.3 megabytes taken up in the database. The imagedata table is reporting 9687 images with 4.0 gigabytes in the table. I have 13 gigabytes of storage on the server in the /var directory.
The imagedata table has stopped accepting data. The reason for this is unclear to me. Does anyone know what might be causing this problem?
I’m a bit suspicious that this might be a MySQL limitation because the problem occured just as the imagedata table reached 4 gigabytes.
What Linux version are you running?
What version of MySQL are you using?
What is the table type of "imagedata"?
What is the column type you are using to store the image?
You probably should be using the "InnoDB" table type, available after MySQL 3.23.29. The 4GB limit translates to a 32-bit integer; some older versions of Linux cannot handle more than a 32-bit file offset, which is why the file size is limited to 4GB. Never versions of Linux handle 64-bit offsets.
Hmmm… I use the redhat / ext3 file system myself, not reiserfs, so I will defer to persons more knowledgeable . I note that the curren version of reiserfs is 4+, (seehttp://www.namesys.com/v4/v4.html) but 3+ does not seem to have the limitation you describe. Your kernel version seems ok. What version of php are you using?
Sam, it looks like you may have already found the solution. The article you reference says this:
---------- Begin quoted text ----------
By default, MySQL creates MyISAM tables with an internal structure that allows a maximum size of about 4GB. You can check the maximum table size for a table with the SHOW TABLE STATUS statement or with myisamchk -dv tbl_name. See Section 13.5.4, SHOW Syntax.
If you need a MyISAM table that is larger than 4GB in size (and your operating system supports large files), the CREATE TABLE statement allows AVG_ROW_LENGTH and MAX_ROWS options. See Section 13.1.5, CREATE TABLE Syntax. You can also change these options with ALTER TABLE after the table has been created, to increase the table’s maximum allowable size. See Section 13.1.2, ALTER TABLE Syntax.
AFAIK, InnoDB tables automatically resize - because they are composed of multiple files unlike the other table types. I have never had to "enlarge" one.