Problem with TblobField.Loadfromfile

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kaffeburk
Posts: 214
Joined: Mon 29 Jan 2007 08:03

Problem with TblobField.Loadfromfile

Post by kaffeburk » Tue 16 Aug 2011 14:17

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;

kaffeburk
Posts: 214
Joined: Mon 29 Jan 2007 08:03

Post by kaffeburk » Tue 16 Aug 2011 14:50

Add:

Mysql 5.1 / InnoDB
Mydac 6.10.0.8
Delphi Rad Studio 2007

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 17 Aug 2011 08:10

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.

Post Reply