Prüfe, dass innodb_log_file_size groß genug ist – die Empfehlung ist das Zehnfache der größten BLOB-Größe in deinen Zeilen plus die Länge der anderen variablen Längenfelder.
Woher das kommt
Das Folgende stammt aus den MySQL 5.6 Release Notes.
InnoDB Notes
- Important Change: Redo log writes for large, externally stored BLOB fields could overwrite the most recent checkpoint. The 5.6.20 patch limits the size of redo log BLOB writes to 10% of the redo log file size. The 5.7.5 patch addresses the bug without imposing a limitation. For MySQL 5.5, the bug remains a known limitation.
As a result of the redo log BLOB write limit introduced for MySQL 5.6,
innodb_log_file_sizeshould be set to a value greater than 10 times the largest BLOB data size found in the rows of your tables plus the length of other variable length fields (VARCHAR,VARBINARY, andTEXTtype fields). Failing to do so could result in "Row size too large" errors. No action is required if yourinnodb_log_file_sizesetting is already sufficiently large or your tables contain no BLOB data. (Bug #16963396, Bug #19030353, Bug #69477)
Was du auf deiner Version prüfen solltest
SHOW VARIABLES LIKE 'innodb_log_file_size'; SHOW VARIABLES LIKE 'innodb_page_size';Andere Einstellungen, die denselben Fehler erzeugen
- Zeilenformat. Mit
COMPACToderREDUNDANTliegt das In-Row-Limit bei 16 KB Seite grob bei 8000 Bytes.DYNAMICundCOMPRESSEDspeichern lange variable Längenspalten off-page, was die meisten Fälle löst:ALTER TABLE t ROW_FORMAT=DYNAMIC; - Zu viele breite Spalten. Das Limit gilt pro Zeile, nicht pro Spalte, mehrere
VARCHAR(500)-Spalten inutf8mb4summieren sich also schnell: 500 × 4 = 2000 Bytes pro Spalte. - Index-Präfixlänge. Ein separater, aber verwandter Fehler, „Specified key was too long“, stammt vom 3072-Byte-Indexlimit statt vom Zeilenlimit.
Unter MySQL 8.0 ist das Redo-Log ein einzelnes #innodb_redo-Verzeichnis statt ib_logfile*-Dateien, das Ändern der Größe geschieht also durch Setzen von innodb_redo_log_capacity – der Workaround aus der 5.6-Ära gilt nicht mehr.