Home > Database > Mysql Tutorial > What type does mysql use to store images?

What type does mysql use to store images?

WBOY
Release: 2022-05-12 17:15:28
Original
16728 people have browsed it

In mysql, the BLOB type is used to store pictures; the BLOB type is a special binary type that can store large amounts of binary data, including pictures, videos, etc. This type includes TinyBlob, Blob, MediumBlob and LongBlob, the only difference is the storage size.

What type does mysql use to store images?

The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.

What type does mysql use to store pictures?

The BLOB type is a special binary type. BLOB can store large amounts of binary data, such as pictures, videos, etc.

BLOB types include TINYBLOB, BLOB, MEDIUMBLOB and LONGBLOB. The only difference between them is the maximum length.

BLOB introduction

BLOB (binary large object) is a container that can store binary files. In computers, BLOB is often a field type used to store binary files in a database. A BLOB is a large file. A typical BLOB is an image or a sound file. Due to their size, they must be processed in a special way (for example: uploaded, downloaded, or stored in a database).

According to Eric Raymond, the main idea of ​​processing BLOB is to let the file processor (such as the database manager) not care about what the file is, but care about how to process it. However, some experts emphasized that this method of processing big data objects is a double-edged sword. It may cause some problems, such as storing binary files that are too large, which will degrade the performance of the database. Storing large multimedia objects in the database is a typical example of applications processing BLOBs.

mysql BLOB type

In MySQL, BLOB is a type series, including: TinyBlob, Blob, MediumBlob, LongBlob. The only difference between these types is the maximum size of the stored file. different.

MySQL’s four BLOB types

Type size (unit: bytes)

  • TinyBlob maximum 255

  •  Blob maximum 65K

  • MediumBlob maximum 16M

  • LongBlob maximum 4G

Recommended learning : mysql video tutorial

The above is the detailed content of What type does mysql use to store images?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template