String Data Types
Store text and binary data. This section covers character types like CHAR, VARCHAR, and TEXT, as well as binary types like BLOB and BINARY.
Last updated
Was this helpful?
Store text and binary data. This section covers character types like CHAR, VARCHAR, and TEXT, as well as binary types like BLOB and BINARY.
Overview of large object types. This page compares BLOB (binary) and TEXT (character) types, explaining their storage and usage differences.
Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.
Variable-length binary large object. BLOB columns can store binary data up to 65,535 bytes, suitable for images or other non-text files.
Fixed-length character string type. CHAR columns store strings of a specified length (0 to 255), padding with spaces if necessary.
Fixed-length character string type. CHARACTER columns store strings of a specified length (0 to 255), padding with spaces if necessary.
Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.
CHAR VARYING is a synonym for the VARCHAR string data type.
In Oracle mode, CLOB is an alias for the LONGTEXT data type used to store large text objects.
Complete ENUM type reference: ENUM('v1','v2') syntax, CHARACTER SET/COLLATE options, NULL/empty string defaults, and numeric index sorting guidelines.
IPv4 address data type. Stores IPv4 addresses as 4-byte binary strings for efficient storage and retrieval.
IPv6 address data type. Stores IPv6 addresses as 16-byte binary strings, also supporting IPv4 addresses via mapping.
Complete JSON Data Type data type guide for MariaDB. Complete reference for syntax, valid values, storage requirements, and range limits for production use.
LONG and LONG VARCHAR are compatibility synonyms for the MEDIUMTEXT string data type.
LONG CHAR VARYING is a compatibility synonym for the MEDIUMTEXT string data type.
LONG CHARACTER VARYING is a compatibility synonym for the MEDIUMTEXT string data type.
LONG VARBINARY is a compatibility synonym for the MEDIUMBLOB binary data type.
LONG VARCHAR is a compatibility synonym for the MEDIUMTEXT string data type.
LONG VARCHARACTER is a compatibility synonym for the MEDIUMTEXT string data type.
Very large binary object. A LONGBLOB column can store up to 4GB of binary data.
Complete LONGTEXT type reference: 4GB (2^32-1) storage limit, CHARACTER SET/COLLATE syntax, max_allowed_packet constraints, and JSON/CLOB aliases.
Medium-sized binary object. A MEDIUMBLOB column can store up to 16MB of binary data.
Medium-sized character string. A MEDIUMTEXT column can store up to 16MB of text data.
NATIONAL CHAR is a synonym for the CHAR data type that uses the predefined utf8mb3 character set.
NATIONAL CHAR VARYING is a synonym for VARCHAR that uses the predefined utf8 character set.
NATIONAL CHARACTER VARYING is a synonym for VARCHAR using the predefined utf8 character set.
NATIONAL CHARACTER is a synonym for the CHAR data type using the predefined utf8 character set.
NATIONAL VARCHAR is a synonym for the VARCHAR data type using the predefined utf8 character set.
NATIONAL VARCHARACTER is a synonym for VARCHAR using the predefined utf8 character set.
NCHAR is a synonym for the fixed-length CHAR string data type using the utf8mb3 character set.
NCHAR VARCHAR is a synonym for the VARCHAR string data type using the utf8 character set.
NCHAR VARCHARACTER is a synonym for VARCHAR using the utf8 character set.
NCHAR VARYING is a synonym for the VARCHAR string data type using the utf8 character set.
In Oracle mode, RAW is a variable-length binary data type synonymous with VARBINARY.
ROW is a data type used in stored programs to store a complete row of data from a cursor or table.
String object with zero or more values from a predefined list. A SET column can store multiple values selected from a list of permitted strings.
Complete TEXT type reference: TEXT(M) syntax, 65,535 byte maximum, 2-byte length prefix, DEFAULT value support, and indexing constraints rules.
Very small binary object. A TINYBLOB column can store up to 255 bytes of binary data.
Very small character string. A TINYTEXT column can store up to 255 characters.
Official UUID data type reference: 128-bit storage optimization, CAST from CHAR/VARCHAR/BINARY types, RFC4122 string format, and UUIDv6/v7 support.
Variable-length binary string type. VARBINARY columns store binary strings of variable length up to a specified maximum.
Complete VARCHAR reference: VARCHAR(M) syntax, length limits (0-65532 per row), CHARACTER SET/COLLATE options, indexing rules, and trailing spaces.
Variable-length character string type. VARCHAR2 columns store strings of variable length up to a specified maximum (up to 65,535).
Variable-length character string type. VARCHARACTER columns store strings of variable length up to a specified maximum (up to 65,535).
The XMLTYPE data type, available from MariaDB 12.3, for storing XML data.
Learn about character sets in MariaDB Server. This section details how different character sets and collations impact string storage, comparison, and sorting within your database.
Last updated
Was this helpful?
Was this helpful?

