mysql创建表时,提示[Err] 1118 - Row size too large

来源:互联网 发布:在线试衣软件 编辑:程序博客网 时间:2024/05/29 05:10
今天创建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


0 0
原创粉丝点击