0

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.

The error is shown in this picture

1 Answer 1

0

You have to consider more things to do this job.

  1. 'max_allowed_packet'

    mysql> show variables like 'max_allowed_packet';

  2. 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

  3. 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?

MySQL - Uploading Image To BLOB Max Upload Size?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.