
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What is BLOB data type in MySQL?
A BLOB is binary large object that can hold a variable amount of data. Followings are some points about BLOB data type −
- BLOB is the family of column type intended as high-capacity binary storage.
- The actual BLOB column type is of four types-TINYBLOB, BLOB, MEDIUMBLOB and LONGBLOB.
- The four BLOB types are very similar to each other; the only difference is the maximum amount of data each can store.
Example − Following example shows how to declare a column as BLOB.
mysql> Create table stock(ID INT, Name VARCHAR(40), PHOTO BLOB, Quantity INT); Query OK, 0 rows affected (0.15 sec) mysql> Describe stock; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+ | ID | int(11) | YES | | NULL | | | Name | varchar(40) | YES | | NULL | | | PHOTO | blob | YES | | NULL | | | Quantity | int(11) | YES | | NULL | | +----------+-------------+------+-----+---------+-------+ 4 rows in set (0.03 sec)
- Related Articles
- What is JDBC Blob data type? how to store and read data from it?
- How to use blob data type in Android sqlite?
- What is TEXT data type in MySQL?
- What is the maximum length of data we can put in a BLOB column in MySQL?
- What is the data type for unix_timestamp in MySQL?
- What is MySQL ENUM data type? What are the advantages to use ENUM data type?
- MySQL query to fetch column length declared with BLOB type
- What should one use CHAR data type or VARCHAR data type in MySQL?
- How to Convert MySQL Table Field Type from BLOB to JSON?
- How to write data into BLOB and CLOB type columns in a table using JDBC?
- What is the best data type to store money values in MySQL?
- What is the difference between MySQL DATETIME and TIMESTAMP data type?
- How to Read data from BLOB and CLOB type columns from a table using JDBC?
- What data type to use for hashed password field in MySQL?
- Which MySQL data type is used for long decimal?

Advertisements