[英]MySQL Data too long for column 'XX' at row 'XX' - LongBlob Column
I have a C# (VS2010) windows application which calls a MySQL(Version 5.6.17) database. 我有一个C#(VS2010)Windows应用程序,它调用MySQL(版本5.6.17)数据库。 In database I am storing files.
在数据库中,我正在存储文件。 I have defined column LONGBLOB to store files.
我已经定义了LONGBLOB列来存储文件。
When I try to insert data to my table I'm getting the error "Data too long for column 'XX' at row 'XX'". 当我尝试向表中插入数据时,出现错误“行'XX'的列'XX'的数据太长”。 I found that by increasing max_allowed_packet this problem can be solved.
我发现通过增加max_allowed_packet可以解决此问题。 But I still get the same error after increasing value of max_allowed_packet.
但是增加max_allowed_packet的值后仍然出现相同的错误。
I cannot even insert a 70 KB file. 我什至不能插入70 KB文件。 I can only insert only small files as 20-30KB
我只能插入20-30KB的小文件
I cannot save files in a hard drive and store only path in the database due to some restrictions. 由于某些限制,我无法将文件保存在硬盘中,而只能在数据库中存储路径。 So I cannot store path in database.
所以我不能在数据库中存储路径。
Please help me. 请帮我。 Thanks
谢谢
I believe you need to increase size of column data type to some higher values. 我相信您需要将列数据类型的大小增加到一些更高的值。 Increasing max_allowed_packet will only help when you are importing data from a sql dump in your database.
仅当从数据库中的sql dump导入数据时,增加max_allowed_packet才有帮助。
Good Luck 祝好运
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.