This section explains storage requirements for different data types in MySQL. The storage requirements depend on different factors. The storage engines represent data types and store raw data differently.
A table has a maximum row size of 65,535 bytes, even if the storage engine is capable of supporting larger rows. BLOB and TEXT data types are excluded.
The following table explains the storage details for numeric data types:
Data Type
|
Storage required
|
TINYINT | 1 byte |
SMALLINT | 2 bytes |
MEDIUMINT | 3 bytes |
INT, INTEGER | 4 bytes |
BIGINT | 8 bytes |
FLOAT(p) |
4 bytes if 0<=p<=24, 8 bytes if 25<=p<=53 |
FLOAT | 4 bytes |
DOUBLE [precision], REAL | 8 bytes |
DECIMAL(M, D), NUMERIC(M, D) | Varies |
BIT(M) | Approximately (M+7)/8 bytes |
The following table...