Databases (MySQL / phpMyAdmin)

How to Fix MySQL error "Row size too large"

By the Domain India teamPublished 8 min read
Knowledge base article
Contents (9 sections)

The "Row size too large" error appears when you create a table, add a column or import a database, and MySQL or MariaDB decides one row could hold more data than InnoDB can store in a row. It is almost always fixed by changing the table, not the server. This guide explains the two limits behind the error and the fixes that work on shared hosting and on your own server.

Key takeaways

Check which of the two messages you have. "Row size too large (> 8126)" is InnoDB's per-page limit: convert the table to ROW_FORMAT=DYNAMIC and change large VARCHAR or CHAR columns to TEXT. "The maximum row size ... is 65535" is MySQL's limit on the total of all non-BLOB columns: shrink those columns or move them to TEXT. Both fixes run as SQL, so they work in phpMyAdmin on shared hosting. Changing the InnoDB log file size doesn't fix either error, and deleting InnoDB log or data files is never a fix.

1. The two errors and what they mean

There are two different limits, and the message tells you which one you hit.

MessageLimitUsual cause
Row size too large (> 8126). Changing some columns to TEXT or BLOB may helpInnoDB stores a row inside a 16 KB page, so the in-row part must fit in about half a pageMany VARCHAR/CHAR columns, or a table in the old COMPACT or REDUNDANT row format
Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535The total declared size of all non-BLOB, non-TEXT columns, in bytesMany long VARCHAR columns, especially with utf8mb4 (up to 4 bytes per character)

Two details catch people out:

  • Character sets multiply sizes. VARCHAR(1000) in utf8mb4 can need up to 4,000 bytes, not 1,000.
  • TEXT and BLOB are different. Their contents can be stored outside the row, leaving only a small pointer in it. That is why moving large columns to TEXT fixes both errors.

2. Find the table and check its row format

In phpMyAdmin, open the SQL tab for your database and run:

sql
SELECT TABLE_NAME, ROW_FORMAT, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = DATABASE()
ORDER BY ROW_FORMAT;

Any InnoDB table showing Compact or Redundant is a candidate for fix 1. To see a table's columns and their sizes, run SHOW CREATE TABLE your_table;.

Back up before you change a table

Export the database, or at least the table, before running any ALTER TABLE. Our guide on backing up a database with phpMyAdmin shows how.

3. Fix 1: switch the table to the DYNAMIC row format

The DYNAMIC row format stores long variable-length columns (VARCHAR, TEXT, BLOB) off the page when they don't fit, keeping only a 20-byte pointer in the row. Older tables created with COMPACT keep the first 768 bytes of each such column in the row, which fills the page quickly.

sql
ALTER TABLE your_table ROW_FORMAT=DYNAMIC;

DYNAMIC has been the default for new tables for years, but tables created long ago, or imported from a dump that contains ROW_FORMAT=COMPACT, keep the old format.

If the error happens during an import, open the .sql file in a text editor and change ROW_FORMAT=COMPACT (or REDUNDANT) to ROW_FORMAT=DYNAMIC in the CREATE TABLE lines, then import again.

4. Fix 2: move large columns to TEXT

If the table is already DYNAMIC, or you hit the 65,535-byte limit, the table has too many wide fixed or variable columns. Convert the largest ones to TEXT (up to 64 KB) or MEDIUMTEXT (up to 16 MB):

sql
ALTER TABLE your_table
  MODIFY description TEXT,
  MODIFY notes TEXT;

Good candidates are long descriptions, notes, addresses, JSON and anything declared as VARCHAR(1000) or larger. Short columns that you search or sort on often, such as a name or a code, can stay as VARCHAR.

Also look for columns that are simply too wide. A VARCHAR(255) for a phone number, or CHAR(255) anywhere, wastes row space; CHAR always reserves its full length.

5. Fix 3: split a very wide table

A table with dozens of large columns is often a design problem. Move rarely used columns into a second table with the same primary key:

sql
CREATE TABLE product_details (
  product_id INT PRIMARY KEY,
  long_description MEDIUMTEXT,
  specifications MEDIUMTEXT,
  FOREIGN KEY (product_id) REFERENCES products(id)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;

Your application then joins the two tables when it needs the extra data. This is also faster for queries that don't need those columns.

6. Why the old server-setting fixes are wrong

Older guides, including an earlier version of this one, suggested changing server settings. They don't fix this error, and some are dangerous.

  • innodb_log_file_size and innodb_log_buffer_size control the redo log. They matter for a different error about very large BLOB or TEXT writes in one transaction, not for row size.
  • innodb_page_size can only be set when the database server is first created. Changing it on an existing server stops MariaDB or MySQL from starting.
  • Turning off innodb_strict_mode turns the error into a warning when a table is created, but inserts that fill the columns can still fail later. Treat it as a way to see the problem, not a fix.
Never delete InnoDB log or data files

Deleting ib_logfile0, ib_logfile1, ibdata1 or any other file in the MySQL data folder does not fix a row-size error. It can destroy every database on the server, with no way to recover without a backup. Current MariaDB and MySQL versions resize their redo logs without any file deletion.

7. On shared hosting and on your own server

On Domain India shared hosting you can't change server settings, and you don't need to: fixes 1 to 3 are SQL statements you run in phpMyAdmin on your own database. Our cPanel and DirectAdmin servers run MariaDB with InnoDB strict mode on, DYNAMIC as the default row format and 16 KB pages (checked on the servers on 23 September 2026). phpMyAdmin shows the exact version on its home page. For other database errors, see database troubleshooting and managing your database in phpMyAdmin. If an import is too large for phpMyAdmin (the limit on cPanel is 50 MB), open a ticket.

On your own VPS or server, the same table fixes apply first. You can also check the server defaults:

sql
SELECT @@version, @@innodb_default_row_format,
       @@innodb_page_size, @@innodb_strict_mode;

If innodb_default_row_format is not dynamic, set it in the [mysqld] section of your configuration file and restart the database service with systemctl restart mariadb (or mysqld for MySQL). Existing tables keep their format until you run ALTER TABLE.

8. Where Domain India fits

Every Domain India cPanel and DirectAdmin plan includes MySQL-compatible MariaDB databases, phpMyAdmin and weekly JetBackup backups. On cPanel, JetBackup can restore a single database on its own.

cPanel Starter
₹125/mo + GST
  • 25 GB NVMe SSD Storage
  • 50 GB Monthly Bandwidth
  • 1 Website
  • 10 Email Accounts
See plan details

If your application needs server-level database tuning, a self-managed VPS gives you full control of the database configuration.

VPS Starter
₹552.65/mo + GST
  • 1 vCPU
  • 2 GB DDR4 RAM
  • 64 GB NVMe SSD Storage
  • 2 TB Monthly Bandwidth
See plan details

Frequently asked questions

How do I fix "Row size too large (> 8126)"?

Convert the table to the DYNAMIC row format with ALTER TABLE your_table ROW_FORMAT=DYNAMIC, and change large VARCHAR or CHAR columns to TEXT. Back up the table first. Both run as SQL, so they work in phpMyAdmin on shared hosting.

What does the 65535 row size limit mean?

MySQL and MariaDB limit the total declared size of all columns except BLOB and TEXT to 65,535 bytes per row. With utf8mb4, each character can need 4 bytes, so a few long VARCHAR columns reach the limit. Move the longest ones to TEXT.

Will increasing innodb_log_file_size fix the row size error?

No. The redo log size does not affect the row size limit. It matters only for a different error about very large BLOB or TEXT writes in a single transaction.

Can I change innodb_page_size to fix the error?

Not on an existing server. The page size is fixed when the database server is first set up, and changing it afterwards stops the server from starting. Change the table instead.

Is it safe to delete ib_logfile or ibdata1 files?

No. Deleting InnoDB log or data files can destroy every database on the server and does not fix a row size error. Current MariaDB and MySQL versions resize their logs without deleting files.

Can I fix this error on Domain India shared hosting?

Yes. The fixes are SQL statements you run in phpMyAdmin on your own database, such as changing the row format or moving large columns to TEXT. You don't need any server setting changed.

Ready to fix it? Back up the table, run the row-format check in phpMyAdmin, and apply fix 1 or 2. If the error persists, open a ticket with the full error message and the table's CREATE TABLE statement, or use our 24/7 live chat.

Hosting with MariaDB, phpMyAdmin and weekly backups

Create databases in minutes and restore from weekly JetBackup backups when you need to.

See cPanel plans

Ready when you are

Get cPanel hosting from ₹125/mo + GST

See plans

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
Fix MySQL "Row size too large"