MySQL 错误 1118 行大小太大 (> 8126)
MySQL error 1118 Row size too large (> 8126)
我的 MySQL 数据库有问题。我想 运行 一个巨大的 insert/on 重复语句并收到 1118 错误。
这个问题的神秘之处在于,它取决于"complete"语句。如果我删除一行中的一个字符(哪一行无关紧要),该语句将起作用。如果我添加一个字符(哪一行无关紧要),我会收到 1118 错误。
我曾尝试增加 my.ini 的许多值,例如innodb_log_file_size、innodb_buffer_pool_size 和 innodb_log_buffer_size。对我没有任何作用。
限制在哪里?
我可以 运行 以下内容,但是带有 Varchar(1) 的 3 个变量被删除了。如果我将 Varchar 更改为文本,我会收到错误消息。
由于 Whosebug 的字符限制,我已将我的声明上传到此处:http://pastie.org/private/yriegkyurqavnqezzbsqta
在 '' 之间你可以填充大约 12569 个随机字符,无论你在哪里填充它们,在 12570 之后我收到错误。
This is the create table code:
CREATE TABLE `produktliste_icecat` (
`EAN` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Fehler` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_high` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_low` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_thumb` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Name` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Titel` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Quality` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Anleitung` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Datenblatt` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_URL` VARCHAR(500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Garantie` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Beschreibung_kurz` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Beschreibung_lang` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Zusammenfassung_kurz` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Zusammenfassung_lang` VARCHAR(1500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Titel` VARCHAR(1500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Name` VARCHAR(1) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert` VARCHAR(1) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie_Zuordner` VARCHAR(1) NOT NULL COLLATE 'utf8_general_ci',
`Icecat_Eigenschaft_Titel_ID` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_alternative_EAN` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_presentation` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_local` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie_Eigenschaft_suchbar` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Titel_Prio` VARCHAR(3300) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_Prio` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
UNIQUE INDEX `EAN` (`EAN`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;
这是我的 my.ini:
[mysqld]
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "Z:/xampp_sql/data"
pid_file = "mysql.pid"
key_buffer = 1G
max_allowed_packet = 500M
sort_buffer_size = 4M
net_buffer_length = 4M
read_buffer_size = 50M
read_rnd_buffer_size = 1024K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
innodb_buffer_pool_size = 1G
query_cache_type = 1
innodb_log_file_size = 20000M
innodb_log_buffer_size=1250M
innodb_flush_log_at_trx_commit=2
innodb_thread_concurrency=0
innodb_file_per_table
bind-address="0.0.0.0"
plugin_dir = "C:/xampp/mysql/lib/plugin/"
skip-federated
server-id = 1
innodb_data_home_dir = "C:/xampp/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/xampp/mysql/data"
innodb_additional_mem_pool_size = 2M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
有谁知道我如何 运行 语句中包含超过 12570 个字符的语句?
提前致谢!
使用您的创建 table,以及您从 pastie url 中插入语句(删除了数据库名称引用)
这就是我得到的
Error 1406: Data too long for column
Icecat_Eigenschaft_Wert_presentation
这是一个 varchar(1000)
.
解决这个问题并继续处理下一条错误消息(大概)。解决这个问题。冲洗并重复。
我只是收到了一条不同的错误消息,如上所示。
运行 mysql 5.6.24.
参见手册页 Limits on InnoDB Tables:
Although InnoDB supports row sizes larger than 65,535 bytes
internally, MySQL itself imposes a row-size limit of 65,535 for the
combined size of all columns:
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 maximum row length, except for variable-length columns (VARBINARY,
VARCHAR, BLOB and TEXT), is slightly less than half of a database
page. That is, the maximum row length is about 8000 bytes. LONGBLOB
and LONGTEXT columns must be less than 4GB, and the total row length,
including BLOB and TEXT columns, must be less than 4GB.
If a row is less than half a page long, all of it is stored locally
within the page. If it exceeds half a page, variable-length columns
are chosen for external off-page storage until the row fits within
half a page, as described in Section 14.12.2, “File Space Management”.
The row size for BLOB columns that are chosen for external off-page
storage should not exceed 10% of the combined redo log file size. If
the row size exceeds 10% of the combined redo log file size, InnoDB
could overwrite the most recent checkpoint which may result in lost
data during crash recovery. (Bug#69477).
因此,当您达到某个阈值时,开始转换为 TEXT
数据类型等。
我的 MySQL 数据库有问题。我想 运行 一个巨大的 insert/on 重复语句并收到 1118 错误。
这个问题的神秘之处在于,它取决于"complete"语句。如果我删除一行中的一个字符(哪一行无关紧要),该语句将起作用。如果我添加一个字符(哪一行无关紧要),我会收到 1118 错误。
我曾尝试增加 my.ini 的许多值,例如innodb_log_file_size、innodb_buffer_pool_size 和 innodb_log_buffer_size。对我没有任何作用。
限制在哪里?
我可以 运行 以下内容,但是带有 Varchar(1) 的 3 个变量被删除了。如果我将 Varchar 更改为文本,我会收到错误消息。
由于 Whosebug 的字符限制,我已将我的声明上传到此处:http://pastie.org/private/yriegkyurqavnqezzbsqta
在 '' 之间你可以填充大约 12569 个随机字符,无论你在哪里填充它们,在 12570 之后我收到错误。
This is the create table code:
CREATE TABLE `produktliste_icecat` (
`EAN` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Fehler` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_high` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_low` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Bild_thumb` VARCHAR(250) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Name` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Titel` VARCHAR(200) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Quality` VARCHAR(50) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Anleitung` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Datenblatt` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_URL` VARCHAR(500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Garantie` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Beschreibung_kurz` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Beschreibung_lang` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Zusammenfassung_kurz` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Zusammenfassung_lang` VARCHAR(1500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Titel` VARCHAR(1500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Name` VARCHAR(1) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert` VARCHAR(1) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie_Zuordner` VARCHAR(1) NOT NULL COLLATE 'utf8_general_ci',
`Icecat_Eigenschaft_Titel_ID` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_alternative_EAN` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_presentation` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_local` TEXT NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie` VARCHAR(100) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Kategorie_Eigenschaft_suchbar` VARCHAR(2500) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Titel_Prio` VARCHAR(3300) NOT NULL COLLATE 'utf8_unicode_ci',
`Icecat_Eigenschaft_Wert_Prio` VARCHAR(700) NOT NULL COLLATE 'utf8_unicode_ci',
UNIQUE INDEX `EAN` (`EAN`)
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;
这是我的 my.ini:
[mysqld]
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql"
tmpdir = "C:/xampp/tmp"
datadir = "Z:/xampp_sql/data"
pid_file = "mysql.pid"
key_buffer = 1G
max_allowed_packet = 500M
sort_buffer_size = 4M
net_buffer_length = 4M
read_buffer_size = 50M
read_rnd_buffer_size = 1024K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
innodb_buffer_pool_size = 1G
query_cache_type = 1
innodb_log_file_size = 20000M
innodb_log_buffer_size=1250M
innodb_flush_log_at_trx_commit=2
innodb_thread_concurrency=0
innodb_file_per_table
bind-address="0.0.0.0"
plugin_dir = "C:/xampp/mysql/lib/plugin/"
skip-federated
server-id = 1
innodb_data_home_dir = "C:/xampp/mysql/data"
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = "C:/xampp/mysql/data"
innodb_additional_mem_pool_size = 2M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
有谁知道我如何 运行 语句中包含超过 12570 个字符的语句?
提前致谢!
使用您的创建 table,以及您从 pastie url 中插入语句(删除了数据库名称引用)
这就是我得到的
Error 1406: Data too long for column Icecat_Eigenschaft_Wert_presentation
这是一个 varchar(1000)
.
解决这个问题并继续处理下一条错误消息(大概)。解决这个问题。冲洗并重复。
我只是收到了一条不同的错误消息,如上所示。
运行 mysql 5.6.24.
参见手册页 Limits on InnoDB Tables:
Although InnoDB supports row sizes larger than 65,535 bytes internally, MySQL itself imposes a row-size limit of 65,535 for the combined size of all columns:
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 maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT), is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes. LONGBLOB and LONGTEXT columns must be less than 4GB, and the total row length, including BLOB and TEXT columns, must be less than 4GB.
If a row is less than half a page long, all of it is stored locally within the page. If it exceeds half a page, variable-length columns are chosen for external off-page storage until the row fits within half a page, as described in Section 14.12.2, “File Space Management”.
The row size for BLOB columns that are chosen for external off-page storage should not exceed 10% of the combined redo log file size. If the row size exceeds 10% of the combined redo log file size, InnoDB could overwrite the most recent checkpoint which may result in lost data during crash recovery. (Bug#69477).
因此,当您达到某个阈值时,开始转换为 TEXT
数据类型等。