Home > Database > Mysql Tutorial > How to Resolve MySQL Error Code 1118: Row Size Too Large?

How to Resolve MySQL Error Code 1118: Row Size Too Large?

Mary-Kate Olsen
Release: 2025-01-05 01:09:08
Original
637 people have browsed it

How to Resolve MySQL Error Code 1118: Row Size Too Large?

Tackling Error Code 1118: Row Size Exceeds Limit in MySQL

Encountering Error Code 1118 in MySQL indicates that the size of a row exceeds the permissible limit of 8126 bytes. This issue commonly arises when creating extensive tables with numerous columns.

To address this error, consider implementing the following solutions:

Optimize Column Types:

In your schema, you have declared some columns as CHAR(1), implying a character limit of only one character. Replacing these with TEXT or BLOB columns would significantly increase their capacity. Additionally, avoid using LONG columns.

Enable Barracuda File Format:

MySQL's Barracuda file format enhances performance and allows for larger row sizes. To activate it, add the following attributes to your MySQL configuration file (my.ini):

innodb_file_per_table=1
innodb_file_format=Barracuda
innodb_file_format_check = ON
Copy after login

Adjust innodb_strict_mode:

If the previous measures yield no success, try modifying the innodb_strict_mode parameter to 0. This setting relaxes the row size check and allows for records to be inserted even if their size exceeds the specified limit:

innodb_strict_mode             = 0
Copy after login

As you mentioned in your query, note that you cannot modify the table's structure due to legacy restrictions. Therefore, explore the above solutions and identify the most suitable approach for your specific application.

The above is the detailed content of How to Resolve MySQL Error Code 1118: Row Size Too Large?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template