mysql 一次插入多個text字段類型的數據 Row size too large (> 8126)


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 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM