The effective maximum table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits. For up-to-date information operating system file size limits, refer to the documentation specific to your operating system.
Windows users, please note that FAT and VFAT (FAT32) are not considered suitable for production use with MySQL. Use NTFS instead.
If you encounter a full-table error, there are several reasons why it might have occurred:
The disk might be full.
You are using
InnoDBtables and have run out of room in an
InnoDBtablespace file. The maximum tablespace size is four billion pages (64TB), which is also the maximum size for a table. See Section 22.214.171.124, “Limits on InnoDB Tables”.
Generally, partitioning of tables into multiple tablespace files is recommended for tables larger than 1TB in size.
You have hit an operating system file size limit. For example, you are using
MyISAMtables on an operating system that supports files only up to 2GB in size and you have hit this limit for the data file or index file.
You are using a
MyISAMtable and the space required for the table exceeds what is permitted by the internal pointer size.
MyISAMpermits data and index files to grow up to 256TB by default, but this limit can be changed up to the maximum permissible size of 65,536TB (2567 − 1 bytes).
If you need a
MyISAMtable that is larger than the default limit and your operating system supports large files, the
CREATE TABLEstatement supports
MAX_ROWSoptions. See Section 13.1.17, “CREATE TABLE Syntax”. The server uses these options to determine how large a table to permit.
ALTER TABLE tbl_name MAX_ROWS=1000000000 AVG_ROW_LENGTH=nnn;
To change the default size limit for
MyISAMtables, set the
myisam_data_pointer_size, which sets the number of bytes used for internal row pointers. The value is used to set the pointer size for new tables if you do not specify the
MAX_ROWSoption. The value of
myisam_data_pointer_sizecan be from 2 to 7. A value of 4 permits tables up to 4GB; a value of 6 permits tables up to 256TB.
You can check the maximum data and index sizes by using this statement:
SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';
Other ways to work around file-size limits for
MyISAMtables are as follows:
If your large table is read only, you can use myisampack to compress it. myisampack usually compresses a table by at least 50%, so you can have, in effect, much bigger tables. myisampack also can merge multiple tables into a single table. See Section 4.6.5, “myisampack — Generate Compressed, Read-Only MyISAM Tables”.
MySQL includes a
MERGElibrary that enables you to handle a collection of
MyISAMtables that have identical structure as a single
MERGEtable. See Section 15.8, “The MERGE Storage Engine”.
You are using the
NDBstorage engine, in which case you need to increase the values for the
IndexMemoryconfiguration parameters in your
config.inifile. See Section 126.96.36.199, “NDB Cluster Data Node Configuration Parameters”.