MySQL Cluster集群导入数据问题处理

ERROR 1118 (42000) at line 141: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 14000. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
在将单点库数据转成cluster集群库的时候,会报上面的错误,那么需要将出错的表中较长的字段改为Text类型或者Blob类型,再继续执行。

官网说法:
3.7.5 Limits Associated with Database Objects in NDB Cluster
Some database objects such as tables and indexes have different limitations when using the NDBCLUSTER storage engine:
Database and table names. When using the NDB storage engine, the maximum allowed length both for database names and for table names is 63 characters.
Number of database objects. The maximum number of all NDB database objects in a single NDB Cluster—including databases, tables, and indexes—is limited to 20320.
Attributes per table. The maximum number of attributes (that is, columns and indexes) that can belong to a given table is 512.
Attributes per key. The maximum number of attributes per key is 32.
Row size. The maximum permitted size of any one row is 14000 bytes. Each BLOB or TEXT column contributes 256 + 8 = 264 bytes to this total.
BIT column storage per table. The maximum combined width for all BIT columns used in a given NDB table is 4096.
FIXED column storage. NDB Cluster supports a maximum of 16 GB per fragment of data in FIXED columns.

再次导入报错:
ERROR 1031 (HY000) at line 141: Table storage engine for 'jc_acquisition' doesn't have this option
多次排除法测试发现,字段数太多导致,如果把更多的varchar255字段改为text,则不再报错。

ERROR 1051 (42S02) at line 559: Unknown table 'jeecmsv93_local.jc_channel'
这是由于外键约束,导致无法删除上次导入失败的表,按顺序逐个删除表或新建库即可。然后所有的trigger用户由root改为应用用户再次导入,报格式错,删除所有的trigger,再次导入报错,一个varchar(2000)的字段改为text即可。

发表评论

电子邮件地址不会被公开。 必填项已用*标注