Store file with more than 1 Mb MySQL

0

I'm trying to write a file to a mySQL database using delphi.

For files with a size of less than 1Mb, this is working fine, however for larger files I'm having problems.

The following error occurred: "MySQL server has gone away".

The initial idea would be to save an exe file.

The type for this field in the table is as MediumBlob.

    
asked by anonymous 02.06.2016 / 14:02

1 answer

1

Dear

This may be a timeout error, not a storage error. Medium Blob, in theory, stores up to 16MB (Version 5.7) according to documentation / a>.

Check the MySQL configuration file, example: /etc/mysql/my.cnf, change or add the parameters (if they do not exist). If you use Wamp change the my.ini.

wait_timeout = 3600

max_allowed_packet = 128M

restart mysql, for example:

sudo /etc/init.d/mysql restart

See if it worked.

    
02.06.2016 / 14:23