Page 1 of 1
Problem writing long file to DB
Posted: Mon 14 Jan 2008 13:19
by Venevtsev
Hello. I have problems with writing big files to DB.
In Delphi 2006 I have exception "Lost connection to MySQL server during query". Big files - files about 1 MB and bigger.
I use LongBlob field, lates MyDAC components, DB is installed on localhost.
Re: Problem writing long file to DB
Posted: Mon 14 Jan 2008 19:30
by eduardosic
Venevtsev wrote:Hello. I have problems with writing big files to DB.
In Delphi 2006 I have exception "Lost connection to MySQL server during query". Big files - files about 1 MB and bigger.
I use LongBlob field, lates MyDAC components, DB is installed on localhost.
Lost Connections have several causes,
check the MySQL variables in my.ini
max_allowed_packet << very important
and
connect_timeout
interactive_timeout
wait_timeout
net_read_timeout
net_write_timeout
slave_net_timeout
max_connections
max_user_connections
Reads help of mysql to know more on the variable's
Posted: Tue 15 Jan 2008 15:44
by Antaeus
It looks like the problem with the max_allowed_packet parameter of MySQL.
Try to set max_allowed_packet to a value that is greater than size of your file.
Just add the following line to the [mysqld] section of
my.ini and restart the server:
Posted: Wed 16 Jan 2008 08:13
by Venevtsev
Thanks a lot!