Home > Database > Mysql Tutorial > MySQL Error 1118: How Can I Fix 'Row Size Too Large' When Creating a Table with Many Columns?

MySQL Error 1118: How Can I Fix 'Row Size Too Large' When Creating a Table with Many Columns?

Barbara Streisand
Release: 2025-01-04 11:34:39
Original
706 people have browsed it

MySQL Error 1118: How Can I Fix

MySQL Error Code 1118: Row Size Too Large

In your attempt to create a table with 325 columns, you encountered error code 1118, indicating that the row size exceeded the limit of 8126 bytes.

You've tried common solutions such as changing VARCHAR to TEXT and enabling Barracuda file format, but the issue persists. One possible cause is strict mode settings in MySQL.

Solution: Disable Strict Mode

To resolve this issue, you can disable strict mode by setting:

innodb_strict_mode = 0
Copy after login

within the MySQL configuration file (my.ini). Strict mode enforces several checks, including row size limitations. Disabling it can allow you to create tables with larger row sizes.

Caution:

Disabling strict mode may make your database less strict when handling data integrity issues. Consider using other techniques, such as reducing the number of columns or using BLOB or TEXT data types, to manage table size efficiently.

Additional Considerations:

  • Refer to the MySQL documentation for more details on strict mode and other potential solutions.
  • If strict mode is essential for maintaining data integrity, you may need to explore alternative options for managing table size, such as partitioning or using a different database engine.

The above is the detailed content of MySQL Error 1118: How Can I Fix 'Row Size Too Large' When Creating a Table with Many Columns?. 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