I'm creating a database and was trying to upload my images into it. However, I encounter a sql server run away error when i tried to upload a 2+MB file.
When I upload a 4MB file, the page simply resets
When i upload a 30+kb file, it works !
I have created the column (longblob) and change the upload_max_file size limit in php.ini to 64MB.
You have to consider more things to do this job.
'max_allowed_packet'
mysql> show variables like 'max_allowed_packet';
Your Column type. MySQL Documentation
TINYBLOB
L+1 bytes, where L < 28 ± 256 bytes BLOB
L+2 bytes, where L < 216 ± 65 kilobytes MEDIUMBLOB
L+3 bytes, where L < 224 ± 16 megabytes LONGBLOB
L+4 bytes, where L < 232 ± 4 gigabytes
The better and faster way is store/upload your image/file into disk storage, not db storage. And just store the file location into db.
And read these link: How can I insert large files in MySQL db using PHP?