MySQL 8.4Lab-verified · 2026-11-30

MySQL ERROR 1118 (42000): Row size too large

The declared column sizes of a row exceed MySQL's 65535-byte limit or InnoDB's 8126-byte limit.

MySQL 8.4.13
1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

Jump to a cause

  1. 01Total VARCHAR size over 65535 bytes in CREATE TABLE
  2. 02ALTER TABLE ADD COLUMN pushes the row over 65535 bytes
  3. 03Many CHAR columns over InnoDB's 8126-byte row limit
  4. 04CREATE TABLE works, but filling the row with UPDATE or INSERT fails (> 8126)

Lab-verifiedReproduced and fixed on MySQL 8.4.13 · 2026-11-30 · container image mysql:8.4

ERROR 1118 has two different messages, and the number tells you which limit you hit.

The maximum row size … is 65535 is MySQL's limit on the total declared size of all columns except TEXT/BLOB. VARCHAR counts in bytes, and with utf8mb4 one character is up to 4 bytes, so VARCHAR(5000) counts as 20000 bytes.

Row size too large (> 8126) is InnoDB's limit: a row must fit in about half of a 16KB page. This can hit tables that stay under 65535.

In both cases the fix verified here is changing large columns to TEXT. Below are four cases reproduced on MySQL 8.4.

01Total VARCHAR size over 65535 bytes in CREATE TABLE

Four VARCHAR(5000) columns in utf8mb4 add up to 4 × 5000 × 4 = 80000 bytes, over 65535. CREATE TABLE survey fails with The maximum row size for the used table type, not counting BLOBs, is 65535.

With the four columns as TEXT, the same CREATE TABLE succeeded. TEXT is not counted in this limit ("not counting BLOBs").

Reproducerun as lab_a
CREATE TABLE survey (
  id INT PRIMARY KEY,
  answer01 VARCHAR(5000),
  answer02 VARCHAR(5000),
  answer03 VARCHAR(5000),
  answer04 VARCHAR(5000)
);
✕ ERROR
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
Checkrun as lab_a
SELECT 4 * 5000 * 4 AS varchar_bytes_utf8mb4;
OUTPUT
+-----------------------+
| varchar_bytes_utf8mb4 |
+-----------------------+
|                 80000 |
+-----------------------+
1 row in set (0.00 sec)
After the fixrun as lab_a
CREATE TABLE survey (
  id INT PRIMARY KEY,
  answer01 TEXT,
  answer02 TEXT,
  answer03 TEXT,
  answer04 TEXT
);
SELECT column_name, data_type FROM information_schema.columns WHERE table_schema = 'lab_a' AND table_name = 'survey' ORDER BY ordinal_position;
✓ SUCCESS
Query OK, 0 rows affected (0.01 sec)

+-------------+-----------+
| COLUMN_NAME | DATA_TYPE |
+-------------+-----------+
| id          | int       |
| answer01    | text      |
| answer02    | text      |
| answer03    | text      |
| answer04    | text      |
+-------------+-----------+
5 rows in set (0.01 sec)

02ALTER TABLE ADD COLUMN pushes the row over 65535 bytes

The notice table already has three VARCHAR(5000) columns, 20000 bytes each in utf8mb4 (60000 total). ALTER TABLE notice ADD COLUMN body3 VARCHAR(5000) would add 20000 more and fails with the 65535 message.

character_maximum_length * 4 in information_schema.columns showed the 20000 bytes per column. ADD COLUMN body3 TEXT succeeded, and SHOW CREATE TABLE showed body3 as text.

Setup
Setuprun as lab_a
CREATE TABLE notice (
  id INT PRIMARY KEY,
  title VARCHAR(5000),
  body1 VARCHAR(5000),
  body2 VARCHAR(5000)
);
OUTPUT
Query OK, 0 rows affected (0.02 sec)
Reproducerun as lab_a
ALTER TABLE notice ADD COLUMN body3 VARCHAR(5000);
✕ ERROR
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
Checkrun as lab_a
SELECT column_name, column_type, character_maximum_length * 4 AS max_bytes FROM information_schema.columns WHERE table_schema = 'lab_a' AND table_name = 'notice' ORDER BY ordinal_position;
OUTPUT
+-------------+---------------+-----------+
| COLUMN_NAME | COLUMN_TYPE   | max_bytes |
+-------------+---------------+-----------+
| id          | int           |      NULL |
| title       | varchar(5000) |     20000 |
| body1       | varchar(5000) |     20000 |
| body2       | varchar(5000) |     20000 |
+-------------+---------------+-----------+
4 rows in set (0.00 sec)

The table creates fine and only fails when it grows. Sum the existing VARCHAR sizes before adding a column.

After the fixrun as lab_a
ALTER TABLE notice ADD COLUMN body3 TEXT;
SHOW CREATE TABLE notice\G
✓ SUCCESS
Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

*************************** 1. row ***************************
       Table: notice
Create Table: CREATE TABLE `notice` (
  `id` int NOT NULL,
  `title` varchar(5000) DEFAULT NULL,
  `body1` varchar(5000) DEFAULT NULL,
  `body2` varchar(5000) DEFAULT NULL,
  `body3` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)

03Many CHAR columns over InnoDB's 8126-byte row limit

Forty CHAR(255) columns in latin1 are 10200 bytes, under 65535, but InnoDB rejects them with Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. This message has only an English version.

The server had innodb_page_size 16384, row format dynamic, and innodb_strict_mode 1. With the 40 columns as TEXT, the table was created, and a row with 255 characters in every column was inserted and read back (len01 and len40 = 255).

Reproducerun as lab_a
CREATE TABLE item_attr (
  id INT PRIMARY KEY,
  attr01 CHAR(255),
  attr02 CHAR(255),
  attr03 CHAR(255),
  attr04 CHAR(255),
  attr05 CHAR(255),
  attr06 CHAR(255),
  attr07 CHAR(255),
  attr08 CHAR(255),
  attr09 CHAR(255),
  attr10 CHAR(255),
  attr11 CHAR(255),
  attr12 CHAR(255),
  attr13 CHAR(255),
  attr14 CHAR(255),
  attr15 CHAR(255),
  attr16 CHAR(255),
  attr17 CHAR(255),
  attr18 CHAR(255),
  attr19 CHAR(255),
  attr20 CHAR(255),
  attr21 CHAR(255),
  attr22 CHAR(255),
  attr23 CHAR(255),
  attr24 CHAR(255),
  attr25 CHAR(255),
  attr26 CHAR(255),
  attr27 CHAR(255),
  attr28 CHAR(255),
  attr29 CHAR(255),
  attr30 CHAR(255),
  attr31 CHAR(255),
  attr32 CHAR(255),
  attr33 CHAR(255),
  attr34 CHAR(255),
  attr35 CHAR(255),
  attr36 CHAR(255),
  attr37 CHAR(255),
  attr38 CHAR(255),
  attr39 CHAR(255),
  attr40 CHAR(255)
) CHARACTER SET latin1;
✕ ERROR
ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
Checkrun as lab_a
SELECT @@innodb_page_size AS page_size, @@innodb_default_row_format AS row_format, @@innodb_strict_mode AS strict_mode;
OUTPUT
+-----------+------------+-------------+
| page_size | row_format | strict_mode |
+-----------+------------+-------------+
|     16384 | dynamic    |           1 |
+-----------+------------+-------------+
1 row in set (0.00 sec)

In the DYNAMIC row format the message says "BLOB prefix of 0 bytes is stored inline": TEXT columns barely count toward the 8126 limit, which is why changing to TEXT helps.

After the fixrun as lab_a
CREATE TABLE item_attr (
  id INT PRIMARY KEY,
  attr01 TEXT,
  attr02 TEXT,
  attr03 TEXT,
  attr04 TEXT,
  attr05 TEXT,
  attr06 TEXT,
  attr07 TEXT,
  attr08 TEXT,
  attr09 TEXT,
  attr10 TEXT,
  attr11 TEXT,
  attr12 TEXT,
  attr13 TEXT,
  attr14 TEXT,
  attr15 TEXT,
  attr16 TEXT,
  attr17 TEXT,
  attr18 TEXT,
  attr19 TEXT,
  attr20 TEXT,
  attr21 TEXT,
  attr22 TEXT,
  attr23 TEXT,
  attr24 TEXT,
  attr25 TEXT,
  attr26 TEXT,
  attr27 TEXT,
  attr28 TEXT,
  attr29 TEXT,
  attr30 TEXT,
  attr31 TEXT,
  attr32 TEXT,
  attr33 TEXT,
  attr34 TEXT,
  attr35 TEXT,
  attr36 TEXT,
  attr37 TEXT,
  attr38 TEXT,
  attr39 TEXT,
  attr40 TEXT
) CHARACTER SET latin1;
INSERT INTO item_attr VALUES (1, REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255), REPEAT('x', 255));
SELECT id, LENGTH(attr01) AS len01, LENGTH(attr40) AS len40 FROM item_attr;
✓ SUCCESS
Query OK, 0 rows affected (0.02 sec)

Query OK, 1 row affected (0.02 sec)

+----+-------+-------+
| id | len01 | len40 |
+----+-------+-------+
|  1 |   255 |   255 |
+----+-------+-------+
1 row in set (0.00 sec)

04CREATE TABLE works, but filling the row with UPDATE or INSERT fails (> 8126)

A latin1 table with 40 VARCHAR(255) columns was created without any error, and a row with only attr01 = 'red' went in. Filling every column with 255 characters (UPDATE ... SET attr01 = REPEAT('x', 255), ...) then failed with Row size too large (> 8126). The table's row format was Dynamic.

So with VARCHAR the check can happen when real data arrives, not when the table is created. After changing 20 of the columns (attr21–attr40) to TEXT with ALTER TABLE ... MODIFY, the same UPDATE matched and changed the row, and len01 and len40 were both 255.

Setup
Setuprun as lab_a
CREATE TABLE item_attr (
  id INT PRIMARY KEY,
  attr01 VARCHAR(255),
  attr02 VARCHAR(255),
  attr03 VARCHAR(255),
  attr04 VARCHAR(255),
  attr05 VARCHAR(255),
  attr06 VARCHAR(255),
  attr07 VARCHAR(255),
  attr08 VARCHAR(255),
  attr09 VARCHAR(255),
  attr10 VARCHAR(255),
  attr11 VARCHAR(255),
  attr12 VARCHAR(255),
  attr13 VARCHAR(255),
  attr14 VARCHAR(255),
  attr15 VARCHAR(255),
  attr16 VARCHAR(255),
  attr17 VARCHAR(255),
  attr18 VARCHAR(255),
  attr19 VARCHAR(255),
  attr20 VARCHAR(255),
  attr21 VARCHAR(255),
  attr22 VARCHAR(255),
  attr23 VARCHAR(255),
  attr24 VARCHAR(255),
  attr25 VARCHAR(255),
  attr26 VARCHAR(255),
  attr27 VARCHAR(255),
  attr28 VARCHAR(255),
  attr29 VARCHAR(255),
  attr30 VARCHAR(255),
  attr31 VARCHAR(255),
  attr32 VARCHAR(255),
  attr33 VARCHAR(255),
  attr34 VARCHAR(255),
  attr35 VARCHAR(255),
  attr36 VARCHAR(255),
  attr37 VARCHAR(255),
  attr38 VARCHAR(255),
  attr39 VARCHAR(255),
  attr40 VARCHAR(255)
) CHARACTER SET latin1;
INSERT INTO item_attr (id, attr01) VALUES (1, 'red');
OUTPUT
Query OK, 0 rows affected (0.02 sec)

Query OK, 1 row affected (0.00 sec)
Reproducerun as lab_a
UPDATE item_attr SET attr01 = REPEAT('x', 255), attr02 = REPEAT('x', 255), attr03 = REPEAT('x', 255), attr04 = REPEAT('x', 255), attr05 = REPEAT('x', 255), attr06 = REPEAT('x', 255), attr07 = REPEAT('x', 255), attr08 = REPEAT('x', 255), attr09 = REPEAT('x', 255), attr10 = REPEAT('x', 255), attr11 = REPEAT('x', 255), attr12 = REPEAT('x', 255), attr13 = REPEAT('x', 255), attr14 = REPEAT('x', 255), attr15 = REPEAT('x', 255), attr16 = REPEAT('x', 255), attr17 = REPEAT('x', 255), attr18 = REPEAT('x', 255), attr19 = REPEAT('x', 255), attr20 = REPEAT('x', 255), attr21 = REPEAT('x', 255), attr22 = REPEAT('x', 255), attr23 = REPEAT('x', 255), attr24 = REPEAT('x', 255), attr25 = REPEAT('x', 255), attr26 = REPEAT('x', 255), attr27 = REPEAT('x', 255), attr28 = REPEAT('x', 255), attr29 = REPEAT('x', 255), attr30 = REPEAT('x', 255), attr31 = REPEAT('x', 255), attr32 = REPEAT('x', 255), attr33 = REPEAT('x', 255), attr34 = REPEAT('x', 255), attr35 = REPEAT('x', 255), attr36 = REPEAT('x', 255), attr37 = REPEAT('x', 255), attr38 = REPEAT('x', 255), attr39 = REPEAT('x', 255), attr40 = REPEAT('x', 255) WHERE id = 1;
✕ ERROR
ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
Checkrun as lab_a
SELECT table_name, row_format FROM information_schema.tables WHERE table_schema = 'lab_a' AND table_name = 'item_attr';
OUTPUT
+------------+------------+
| TABLE_NAME | ROW_FORMAT |
+------------+------------+
| item_attr  | Dynamic    |
+------------+------------+
1 row in set (0.00 sec)
Fixrun as lab_a
ALTER TABLE item_attr
  MODIFY attr21 TEXT,
  MODIFY attr22 TEXT,
  MODIFY attr23 TEXT,
  MODIFY attr24 TEXT,
  MODIFY attr25 TEXT,
  MODIFY attr26 TEXT,
  MODIFY attr27 TEXT,
  MODIFY attr28 TEXT,
  MODIFY attr29 TEXT,
  MODIFY attr30 TEXT,
  MODIFY attr31 TEXT,
  MODIFY attr32 TEXT,
  MODIFY attr33 TEXT,
  MODIFY attr34 TEXT,
  MODIFY attr35 TEXT,
  MODIFY attr36 TEXT,
  MODIFY attr37 TEXT,
  MODIFY attr38 TEXT,
  MODIFY attr39 TEXT,
  MODIFY attr40 TEXT;
OUTPUT
Query OK, 1 row affected (0.04 sec)
Records: 1  Duplicates: 0  Warnings: 0

A table that was created fine can still fail later on long data. Test with a row filled to the maximum length.

After the fixrun as lab_a
UPDATE item_attr SET attr01 = REPEAT('x', 255), attr02 = REPEAT('x', 255), attr03 = REPEAT('x', 255), attr04 = REPEAT('x', 255), attr05 = REPEAT('x', 255), attr06 = REPEAT('x', 255), attr07 = REPEAT('x', 255), attr08 = REPEAT('x', 255), attr09 = REPEAT('x', 255), attr10 = REPEAT('x', 255), attr11 = REPEAT('x', 255), attr12 = REPEAT('x', 255), attr13 = REPEAT('x', 255), attr14 = REPEAT('x', 255), attr15 = REPEAT('x', 255), attr16 = REPEAT('x', 255), attr17 = REPEAT('x', 255), attr18 = REPEAT('x', 255), attr19 = REPEAT('x', 255), attr20 = REPEAT('x', 255), attr21 = REPEAT('x', 255), attr22 = REPEAT('x', 255), attr23 = REPEAT('x', 255), attr24 = REPEAT('x', 255), attr25 = REPEAT('x', 255), attr26 = REPEAT('x', 255), attr27 = REPEAT('x', 255), attr28 = REPEAT('x', 255), attr29 = REPEAT('x', 255), attr30 = REPEAT('x', 255), attr31 = REPEAT('x', 255), attr32 = REPEAT('x', 255), attr33 = REPEAT('x', 255), attr34 = REPEAT('x', 255), attr35 = REPEAT('x', 255), attr36 = REPEAT('x', 255), attr37 = REPEAT('x', 255), attr38 = REPEAT('x', 255), attr39 = REPEAT('x', 255), attr40 = REPEAT('x', 255) WHERE id = 1;
SELECT id, LENGTH(attr01) AS len01, LENGTH(attr40) AS len40 FROM item_attr;
✓ SUCCESS
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

+----+-------+-------+
| id | len01 | len40 |
+----+-------+-------+
|  1 |   255 |   255 |
+----+-------+-------+
1 row in set (0.00 sec)

FAQ

What is the difference between Row size too large 65535 and 8126?

65535 is MySQL's limit on the declared size of all non-TEXT/BLOB columns. 8126 is InnoDB's limit for a row in a 16KB page. A table can pass the first and still fail the second.

How many characters can VARCHAR hold before hitting 65535 in utf8mb4?

The limit is in bytes for the whole row, and utf8mb4 counts 4 bytes per character. Four VARCHAR(5000) columns already count as 80000 bytes.

Why does ALTER TABLE ADD COLUMN fail with 1118 when CREATE TABLE worked?

The new column pushes the row total over the limit. Check character_maximum_length * 4 in information_schema.columns, and add the column as TEXT.

Does changing VARCHAR to TEXT fix Row size too large?

In all three cases here, yes. TEXT is not counted in the 65535 limit, and with the DYNAMIC row format it did not hit the 8126 limit either.

The table was created fine, but INSERT or UPDATE gives Row size too large

With VARCHAR the row size depends on the real data, so long values can hit the 8126 limit later. In the lab, changing 20 of 40 VARCHAR(255) columns to TEXT let the fully filled UPDATE succeed.

How we verify

Each scenario starts from fresh database users. A script runs the setup, confirms the exact error code, applies the fix and runs the statement again. The output shown is what the database printed, saved by the script.

lab_a and lab_b are ordinary users created for the test, each with full rights on a database of the same name (its default database); root is the administrator. MySQL 8.4.13