项目场景:
SQL Server数据库向MySQL迁移
问题描述:
MySQL建表报:Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs, is 6553
原因分析:
我的数据库编码为utf8mb4,数据库设定的varchar长度:(1000+10000+5000+390)*4>65535了,如果是utf8,则是设定的varchar或者其他类型长度乘以3
解决方案:
将比较长的字段类型设置成text而不是varchar