[Err] 1118 - 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

今天创建mysql表时,遇到了[Err] 1118 - Row size too large的问题,sql如下:
drop table if exists Orders;
create table Orders
(
orderNo varchar(50) not null comment '订单号',

invoice varchar(21845) comment 'JSON 发票信息',

primary key (orderNo)
);
提示的错误为:

[Err] 1118 - 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

去网络上查找问题,找到原因:
一个varchar/char占3个字节  每行数据不能超过65535个字节  所以每行的varchar/char不能超过21845
————————————————
版权声明:本文为CSDN博主「mashining1988111」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/mashining1988111/article/details/53022969

你可能感兴趣的:([Err] 1118 - 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)