Skip to content

MyISAM table size limit on a cPanel host — the 4GB ceiling and how to break past it

MyISAM tables on default settings cap at 4GB. Resizing the data and index pointer fields lets the table grow past that, but the real fix is converting to InnoDB.

A MyISAM table on a cPanel host hits 4GB and starts returning “The table ‘foo’ is full.” Default MyISAM uses 4-byte data and index pointers, capping the table size at roughly 4GB. The fix in the MyISAM era was ALTER TABLE ... MAX_ROWS to enlarge the pointers. The fix in 2026 is converting to InnoDB, which has no such limit. Knowing both pathways helps when conversion is blocked and you need to keep MyISAM running for one more day.

What’s happening

MyISAM stores row data in .MYD files and indexes in .MYI files. The format includes a pointer to each row’s offset; by default that pointer is 4 bytes, addressing up to (2^32 - 1) bytes — about 4.3GB per table. Two ways to extend:

  • MAX_ROWS and AVG_ROW_LENGTH hints: tell MyISAM at table creation time that you expect more rows, and it allocates wider pointers. Applied via ALTER TABLE for existing tables.
  • myisam_data_pointer_size = 6: increases the default pointer size to 6 bytes for new tables. Cap goes to ~256TB.

But: if you’re hitting 4GB on a MyISAM table in 2026, the right fix is converting to InnoDB. InnoDB has its own table size limits (64TB for a single file-per-table tablespace, basically irrelevant) and offers crash safety, row-level locking, foreign keys, and transaction support. The conversion article covers the process; this one covers the temporary fix while you plan the conversion.

How to verify

mysql -e "SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE, DATA_LENGTH, MAX_DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE ENGINE='MyISAM' AND DATA_LENGTH > 1000000000 ORDER BY DATA_LENGTH DESC"
mysql -e "SHOW VARIABLES LIKE 'myisam_data_pointer_size'"
mysql -e "SHOW CREATE TABLE acmecorp_legacy.big_table\G"
ls -lh /var/lib/mysql/acmecorp_legacy/big_table.*

The first query lists big MyISAM tables and their current data-length vs the max set by the pointer size. The CREATE TABLE shows whether MAX_ROWS / AVG_ROW_LENGTH were ever set.

The fix

Quick fix (extend the pointer):

  1. Raise the pointer size for this specific table:
    ALTER TABLE acmecorp_legacy.big_table MAX_ROWS=1000000000 AVG_ROW_LENGTH=100;
    The product MAX_ROWS * AVG_ROW_LENGTH gives MyISAM a hint about the expected size; it allocates the necessary pointer width. The ALTER rebuilds the table — slow on a 4GB table, holds a lock during the rebuild.
  2. For new MyISAM tables (rare), set the global default in /etc/my.cnf.d/cpanel.cnf:
    [mysqld]
    myisam_data_pointer_size = 6
    Restart MySQL. New tables use 6-byte pointers.

Real fix (convert to InnoDB):

  1. Take a backup first: mysqldump --single-transaction acmecorp_legacy.big_table > /tmp/big_table.sql. (Note: --single-transaction is for InnoDB; for MyISAM the table is implicitly locked for the dump duration.)
  2. For a 4GB+ MyISAM table, use online schema change:
    pt-online-schema-change --alter "ENGINE=InnoDB" D=acmecorp_legacy,t=big_table --execute
    This creates a shadow InnoDB copy, copies rows incrementally, triggers ongoing changes forward, then swaps the table atomically. Site stays up during the operation.
  3. For smaller MyISAM tables, direct ALTER:
    ALTER TABLE acmecorp_legacy.big_table ENGINE=InnoDB;
    Holds a lock for the duration; schedule during a maintenance window.
  4. Verify post-conversion:
    mysql -e "SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA='acmecorp_legacy' AND TABLE_NAME='big_table'"
    mysql -e "SELECT COUNT(*) FROM acmecorp_legacy.big_table"
  5. Watch for full-text index issues: MyISAM full-text indexes use different stop words than InnoDB. If the application uses MATCH ... AGAINST, expect different search results post-conversion. Tune innodb_ft_min_token_size if necessary.

For environments where MyISAM legacy is reaching the size ceiling across many customers, Stack Harbor’s managed cPanel operations team batches the conversion via pt-online-schema-change and verifies application behavior on each touched table.