Page 1 of 1

Problem with TblobField.Loadfromfile

Posted: Tue 16 Aug 2011 14:17
by kaffeburk
Im trying to load data (a file) into a TBlobfield/longblob. It works with small files like .gif with a size of about 30k. When i try to load a EXE file size of 2.5 mb file i get an error:

Lost connection to mysql during query...Socket error on write..wsa get last error return 10054($2746)

Code:
with q_file do begin

execute;
open;
blob:=FieldbyName('theFile') as TBlobField;
Edit;
blob.LoadFromFile(od_upload.FileName);
Post;
Close;

Posted: Tue 16 Aug 2011 14:50
by kaffeburk
Add:

Mysql 5.1 / InnoDB
Mydac 6.10.0.8
Delphi Rad Studio 2007

Posted: Wed 17 Aug 2011 08:10
by Dimon
To solve the problem try to increase the values of the following variables in the my.ini file, like this:
net_read_timeout = 31536000
net_write_timeout = 31536000
max_allowed_packet = 16M

Also try to increase the size of memory buffers using MySQL server variables like key_buffer_size or innodb_buffer_pool_size. For more information about these variables read MySQL Reference Manual.