mysql插入的一行數據中有多個text類型的字段時報錯如下:
錯誤代碼: 1118
Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
1. 首先text字段較多,參數一般會比較大,設置max_allowed_packet為合適的大小;
2. 參照錯誤提示, "Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help",修改表的行格式為"DYNAMIC"或“COMPRESSED”;
注意:必須先將文件格式設置成Barracuda:set global innodb_file_format=Barracuda;,再用ALTER TABLE tablename ROW_FORMAT=COMPRESSED;去修改才能生效。此處參考:https://www.cnblogs.com/wilburxu/p/9435818.html

參考:https://blog.csdn.net/yyongsheng/article/details/88537343
