Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL: Error Code: 1118 Row size too large (> 8126). Changing some columns to TEXT or BLOB

I want to create a table of 325 column:

CREATE TABLE NAMESCHEMA.NAMETABLE  (          ROW_ID TEXT NOT NULL ,        //this is the primary key  324 column of these types:       CHAR(1),        DATE,        DECIMAL(10,0),        DECIMAL(10,7),        TEXT,        LONG,  ) ROW_FORMAT=COMPRESSED; 

I replaced all the VARCHAR with the TEXT and i have added Barracuda in the my.ini file of MySQL, this is the attributes added:

innodb_file_per_table=1 innodb_file_format=Barracuda innodb_file_format_check = ON 

but i still have this error:

Error Code: 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. 

EDIT: I can't change the structure of the database because it's legacy application/system/database. The create of a new table, it's an export of the legacy database.

EDIT2: i wrote this question that is similar to others but inside there are some solution that i found on internet like VARCHAR and Barracuda, but i still have that problem so i decided to open a new question with already the classic answer inside for seeing if someone have other answers

like image 644
Diego87 Avatar asked Mar 25 '14 14:03

Diego87


People also ask

How do I fix MySQL row size too large 8126?

MySQLSyntaxErrorException: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.

How do I fix Row size too large in MySQL?

Therefore, a potential solution to the Row size too large error is to convert the table to use the DYNAMIC row format. For example: ALTER TABLE tab ROW_FORMAT=DYNAMIC; You can use the INNODB_SYS_TABLES table in the information_schema database to find all tables that use the REDUNDANT or the COMPACT row formats.

How do I change the row limit in MySQL?

You can easily change this limit by going to MySQL Workbench >> Edit >> Preferences >> SQL Queries tab. Over here you will option to Limit Rows. You can set this to very high value or uncheck the option. When you uncheck that option, it will retrieve all the rows from a query (equivalent to no limits).


2 Answers

I tried all the solutions here, but only this parameter

innodb_strict_mode             = 0 

solved my day...

From the manual:

The innodb_strict_mode setting affects the handling of syntax errors for CREATE TABLE, ALTER TABLE and CREATE INDEX statements. innodb_strict_mode also enables a record size check, so that an INSERT or UPDATE never fails due to the record being too large for the selected page size.

like image 112
Stefano Brozzi Avatar answered Sep 19 '22 09:09

Stefano Brozzi


I struggled with the same error code recently, due to a change in MySQL Server 5.6.20. I was able to solve the problem by changing the innodb_log_file_size in the my.ini text file.

In the release notes, it is explained that an innodb_log_file_size that is too small will trigger a "Row size too large error."

http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html

like image 24
user2635717 Avatar answered Sep 21 '22 09:09

user2635717