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.
Problem writing long file to DB
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: Problem writing long file to DB
Lost Connections have several causes,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.
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
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:
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:
Code: Select all
max_allowed_packet = 16M