MySQL:错误代码:1118 行大小太大(> 8126).将某些列更改为 TEXT 或 BLOB

2021-11-20 00:00:00 sql mysql create-table

我想创建一个325列的表格:

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;

我用TEXT替换了所有的VARCHAR,并在MySQL的my.ini文件中添加了Barracuda,这是添加的属性:

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

但我仍然有这个错误:

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.

我无法更改数据库的结构,因为它是遗留应用程序/系统/数据库.新表的创建,是旧数据库的导出.

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.

我写的这个问题与其他问题类似,但里面有一些我在互联网上找到的解决方案,如 VARCHAR 和 Barracuda,但我仍然有这个问题,所以我决定打开一个新问题,里面已经有了经典答案看看是否有人有其他答案

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

推荐答案

由于 MySQL Server 5.6.20 中的更改,我最近遇到了相同的错误代码.我能够通过更改 my.ini 文本文件中的 innodb_log_file_size 来解决问题.

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.

在发行说明中,解释了太小的 innodb_log_file_size 会触发Row size too large 错误".

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

相关文章