Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysql BLOB and TEXT data type difference

What's difference between BLOB and TEXT data type in mysql ? ( except sortable )

like image 794
Hamid Avatar asked Apr 29 '11 06:04

Hamid


People also ask

What is the difference between TEXT and BLOB in MySQL?

BLOB values are treated as binary strings (byte strings). They have the binary character set and collation, and comparison and sorting are based on the numeric values of the bytes in column values. TEXT values are treated as nonbinary strings (character strings).

Is BLOB a data type in MySQL?

BLOB, which stands for a Binary Large Object, is a MySQL data type that can store images, PDF files, multimedia, and other types of binary data.

What is TEXT data type in MySQL?

MySQL TEXT is a standard data type for storing special character strings with maximum sizes or as defined. On the ordering of its character set, the evaluations and sorting are built. In actual, this TEXT data type for a column is composed of four categories. They are TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT.

Is BLOB is a data type?

The BLOB data type stores any kind of binary data in random-access chunks, called sbspaces. Binary data typically consists of saved spreadsheets, program-load modules, digitized voice patterns, and so on.


1 Answers

BLOB is used for storing binary data, while TEXT is used to store large strings.

As stated in the MySQL 5.1 Reference Manual:

BLOB values are treated as binary strings (byte strings). They have no character set, and sorting and comparison are based on the numeric values of the bytes in column values. TEXT values are treated as nonbinary strings (character strings). They have a character set, and values are sorted and compared based on the collation of the character set.

like image 56
Harry Joy Avatar answered Oct 10 '22 19:10

Harry Joy