Report this

What is the reason for this report?

I am trying to import a 15 MB mySQL DB in phpMyAdmin but I get an error. How can I fix this?

Posted on November 23, 2016

This is the error I get:

#1118 - 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.

I searched the error and found some people talking about adding this to /etc/mysql/my.cnf

innodb_log_file_size = 512M

I did that and restarted Apache but I still get the error. I’ve also updated my php.ini file with:

memory_limit = 600M

I’m running a 1GB / 30GB Disk Ubuntu droplet. Is there something I am missing?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I believe that the error is trying to say that when you add up the sizes of your 163 fields, they are larger than the 8126 that your current configuration is allowed.

You are actually attempting to create a row definition or place holder for the data which will have 163 different columns/fields whose total data width is larger than 8126.

Since you are maxing out at 8126, you might look at changing your innodb page size which is usually about double the row max. It’s currently at 16K. I have heard that it can be changed to 32 or even 64K. Or alternately, you can vertically split the table by putting the most important used data in table A and the least used important data in table A1 then linking them in reports and elsewhere via a primary->foreign key. If you just copy paste the create table statement here, it may be obvious to others here as to why the estimated width is larger than the allowed 8K.

On this page: https://dev.mysql.com/doc/refman/8.0/en/innodb-restrictions.html

I see this example which might visually prove to be helpful to you: mysql> CREATE TABLE t (a VARCHAR(8000), b VARCHAR(10000), -> c VARCHAR(10000), d VARCHAR(10000), e VARCHAR(10000), -> f VARCHAR(10000), g VARCHAR(10000)) ENGINE=InnoDB; ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.