今天創建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