Temporary fix for row size too large > 8126 on a Laravel Forge Ubuntu 24.04 server

On a Laravel Forge Ubuntu 24.04 server, you might experience the following issue whilst restoring a database:

mysql -udb_user -p db_name < backup.sql
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Enter password:
ERROR 1118 (42000) at line 969: 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.

A temporary work is to turn off strictness on innodb. You can do it like this:

First, determine which configuration file(s) are in use:

# mariadb --verbose --help | grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf
root@magic:/etc/mysql/mariadb.conf.d#

Unfortunately this only tells part of the story. The actual file is in `/etc/mysql/mariadb.conf.d`:

Then:

vi /etc/mysql/mariadb.conf.d/50-server.cnf

Add this:

[mariadbd]
#operator got row too large error, bypassing strict more for restore of database XXX to work.
innodb_strict_mode=0

Then

service mariadb restart

Then restore the database.

Then, revert your changes.

Sysadmin at work 😉

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *