Store file with more than 1 Mb Mysql

Asked

Viewed 294 times

0

I am trying to write a file to a mysql database using Delphi.

For files with size smaller than 1Mb is working perfectly, however for file with bigger size I am having problems.

The following error occurs: "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.

1 answer

1


Dear

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

Check the Mysql configuration file, example: /etc/mysql/my.cnf, change or add parameters (if they don’t exist). If you use Wamp change my.ini.

wait_timeout = 3600

max_allowed_packet = 128M

restart mysql, for example:

sudo /etc/init. d/mysql Restart

See if it works.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.