Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL - Uploading Image To BLOB Max Upload Size?

Tags:

php

mysql

blob

I'm using file uploading for images into a BLOB in a MySQL database, for some reason when I upload some pictures I noticed they weren't completely rendered, I then tried uploading directly into PHPMyAdmin when it then showed (Max: 64KiB) I luckily enough run my own server so I thought to go check my php.ini for max file upload size, it's set to 250MB. So my question is,

Where is the max filesize for MySQL BLOB Uploads??

like image 261
Ariana Avatar asked Nov 13 '13 01:11

Ariana


People also ask

What is the maximum size of BLOB in MySQL?

BLOB: Can handle up to 65,535 bytes of data. MEDIUMBLOB: The maximum length supported is 16,777,215 bytes. LONGBLOB: Stores up to 4,294,967,295 bytes of data.

How many characters can a BLOB hold?

A BLOB (binary large object) is a varying-length binary string that can be up to 2,147,483,647 characters long.

Can you store image in MySQL?

A Binary Large Object ( BLOB ) is a MySQL data type that can store binary data such as images, multimedia, and PDF files.

What is long BLOB in MySQL?

LONGBLOB: A binary large object column with a maximum length of 4294967295 (2^32 - 1) bytes, or 4GB in storage. Each LONGBLOB value is stored using a four-byte length prefix that indicates the number of bytes in the value.


1 Answers

It depends on the type of your column.

From MySQL documentation:, section Storage Requirements for String Types:

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)

like image 141
Bigood Avatar answered Sep 28 '22 09:09

Bigood