All pages
Powered by GitBook
1 of 55

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

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.

BLOB and TEXT Data Types

Overview of large object types. This page compares BLOB (binary) and TEXT (character) types, explaining their storage and usage differences.

Description

A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are

  • TINYBLOB,

  • ,

  • , and

  • .

These differ only in the maximum length of the values they can hold.

The TEXT types are

  • ,

  • ,

  • , and

  • .

These correspond to the four BLOB types and have the same maximum lengths and .

BLOB and TEXT columns can have a DEFAULT value.

Note

It is possible to set a unique index on columns that use the BLOB or TEXT data types.

See Also

This page is licensed: GPLv2, originally from

JSON (alias for LONGTEXT)
BLOB
MEDIUMBLOB
LONGBLOB
TINYTEXT
TEXT
MEDIUMTEXT
LONGTEXT
storage requirements
Store a column as compressed
fill_help_tables.sql

CHAR VARYING

Overview

This is a synonym for VARCHAR.

EXAMPLES

CREATE TABLE char_varying_example (
  example CHAR VARYING(32)
);
SHOW CREATE TABLE char_varying_example\G
*************************** 1. row ***************************
       Table: char_varying_example
Create Table: CREATE TABLE `char_varying_example` (
  `example` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

CLOB

In Oracle mode, CLOB is an alias for the LONGTEXT data type used to store large text objects.

Overview

This is a synonym for .

EXAMPLES

NATIONAL VARCHARACTER

NATIONAL VARCHARACTER is a synonym for VARCHAR using the predefined utf8 character set.

Overview

See .

EXAMPLES

Character Sets and Collations

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.

Internationalization and Localization

Discover how MariaDB supports internationalization and localization, enabling databases to store and process data in multiple languages.

This page is: Copyright © 2025 MariaDB. All rights reserved.
SET sql_mode='oracle';

CREATE TABLE clob_example (
  example CLOB
);
SHOW CREATE TABLE clob_example\G
*************************** 1. row ***************************
       Table: clob_example
Create Table: CREATE TABLE "clob_example" (
  "example" longtext DEFAULT NULL
)
LONGTEXT
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE national_varcharacter_example (
  example NATIONAL VARCHARACTER(32)
);
SHOW CREATE TABLE national_varcharacter_example\G
*************************** 1. row ***************************
       Table: national_varcharacter_example
Create Table: CREATE TABLE `national_varcharacter_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
NATIONAL VARCHAR

LONG and LONG VARCHAR

LONG and LONG VARCHAR are compatibility synonyms for the MEDIUMTEXT string data type.

LONG and LONG VARCHAR are synonyms for MEDIUMTEXT.

CREATE TABLE t1 (a LONG, b LONG VARCHAR);

DESC t1;
+-------+------------+------+-----+---------+-------+
| Field | Type       | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| a     | mediumtext | YES  |     | NULL    |       |
| b     | mediumtext | YES  |     | NULL    |       |
+-------+------------+------+-----+---------+-------+

This page is licensed: CC BY-SA / Gnu FDL

NATIONAL VARCHAR

NATIONAL VARCHAR is a synonym for the VARCHAR data type using the predefined utf8 character set.

Overview

Variable-length string of specific character set with limit up to 65,535 bytes.

EXAMPLES

CREATE TABLE national_varchar_example (
  example NATIONAL VARCHAR(32)
);
SHOW CREATE TABLE national_varchar_example\G
*************************** 1. row ***************************
       Table: national_varchar_example
Create Table: CREATE TABLE `national_varchar_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

NCHAR

NCHAR is a synonym for the fixed-length CHAR string data type using the utf8 character set.

Overview

See NATIONAL VARCHAR.

EXAMPLES

CREATE TABLE nchar_example (
  example NCHAR(32)
);
SHOW CREATE TABLE nchar_example\G
*************************** 1. row ***************************
       Table: nchar_example
Create Table: CREATE TABLE `nchar_example` (
  `example` char(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

NATIONAL CHAR

NATIONAL CHAR is a synonym for the CHAR data type that uses the predefined utf8 character set.

Overview

Fixed-length string of specific character set with limit up to 255 bytes.

Examples

CREATE TABLE national_char_example (
  example NATIONAL CHAR(32)
);
SHOW CREATE TABLE national_char_example\G
*************************** 1. row ***************************
       Table: national_char_example
Create Table: CREATE TABLE `national_char_example` (
  `example` char(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

External References

Additional information is available .

This page is: Copyright © 2025 MariaDB. All rights reserved.

LONG CHAR VARYING

LONG CHAR VARYING is a compatibility synonym for the MEDIUMTEXT string data type.

Overview

See MEDIUMTEXT.

EXAMPLES

CREATE TABLE long_char_varying_example (
  example LONG CHAR VARYING
);
SHOW CREATE TABLE long_char_varying_example\G
*************************** 1. row ***************************
       Table: long_char_varying_example
Create Table: CREATE TABLE `long_char_varying_example` (
  `example` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

LONG CHARACTER VARYING

LONG CHARACTER VARYING is a compatibility synonym for the MEDIUMTEXT string data type.

Overview

See MEDIUMTEXT.

EXAMPLES

CREATE TABLE long_character_varying_example (
  example LONG CHARACTER VARYING
);
SHOW CREATE TABLE long_character_varying_example\G
*************************** 1. row ***************************
       Table: long_character_varying_example
Create Table: CREATE TABLE `long_character_varying_example` (
  `example` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

NCHAR VARYING

NCHAR VARYING is a synonym for the VARCHAR string data type using the utf8 character set.

Overview

See NATIONAL VARCHAR.

EXAMPLES

CREATE TABLE nchar_varying_example (
  example NCHAR VARYING(32)
);
SHOW CREATE TABLE nchar_varying_example\G
*************************** 1. row ***************************
       Table: nchar_varying_example
Create Table: CREATE TABLE `nchar_varying_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

NCHAR VARCHAR

NCHAR VARCHAR is a synonym for the VARCHAR string data type using the utf8 character set.

Overview

See NATIONAL VARCHAR.

EXAMPLES

CREATE TABLE nchar_varchar_example (
  example NCHAR VARCHAR(32)
);
SHOW CREATE TABLE nchar_varchar_example\G
*************************** 1. row ***************************
       Table: nchar_varchar_example
Create Table: CREATE TABLE `nchar_varchar_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

LONGBLOB

Very large binary object. A LONGBLOB column can store up to 4GB of binary data.

Syntax

Description

A column with a maximum length of 4,294,967,295 bytes (2³² - 1), or 4GB. The effective maximum length of LONGBLOB

CHARACTER

Fixed-length character string type. CHARACTER columns store strings of a specified length (0 to 255), padding with spaces if necessary.

Overview

This is a synonym for .

EXAMPLES

LONGTEXT

Very large character string. A LONGTEXT column can store up to 4GB of text data, subject to protocol limits.

Syntax

Description

A column with a maximum length of 4,294,967,295 or 4GB (2³² - 1) characters. The effective maximum length is less if the value contains multi-byte characters. The effective maximum length of

NCHAR VARCHARACTER

NCHAR VARCHARACTER is a synonym for VARCHAR using the utf8 character set.

Overview

See .

EXAMPLES

NATIONAL CHARACTER

NATIONAL CHARACTER is a synonym for the CHAR data type using the predefined utf8 character set.

Overview

See .

EXAMPLES

LONG VARCHAR

LONG VARCHAR is a compatibility synonym for the MEDIUMTEXT string data type.

Overview

See .

EXAMPLES

This page is: Copyright © 2025 MariaDB. All rights reserved.

LONG VARCHARACTER

LONG VARCHARACTER is a compatibility synonym for the MEDIUMTEXT string data type.

Overview

See .

EXAMPLES

CHAR BYTE

Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.

Description

The CHAR BYTE data type is an alias for the data type. This is a compatibility feature.

NATIONAL CHARACTER VARYING

NATIONAL CHARACTER VARYING is a synonym for VARCHAR using the predefined utf8 character set.

Overview

See .

EXAMPLES

here
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE character_example (
  example CHARACTER
);
SHOW CREATE TABLE character_example\G
*************************** 1. row ***************************
       Table: character_example
Create Table: CREATE TABLE `character_example` (
  `example` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CHAR
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE nchar_varcharacter_example (
  example NCHAR VARCHARACTER(32)
);
SHOW CREATE TABLE nchar_varcharacter_example\G
*************************** 1. row ***************************
       Table: nchar_varcharacter_example
Create Table: CREATE TABLE `nchar_varcharacter_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
NATIONAL VARCHAR
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE national_character_example (
  example NATIONAL CHARACTER(32)
);
SHOW CREATE TABLE national_character_example\G
*************************** 1. row ***************************
       Table: national_character_example
Create Table: CREATE TABLE `national_character_example` (
  `example` char(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
NATIONAL CHAR
CREATE TABLE long_varchar_example (
  example LONG VARCHAR
);
SHOW CREATE TABLE long_varchar_example\G
*************************** 1. row ***************************
       Table: long_varchar_example
Create Table: CREATE TABLE `long_varchar_example` (
  `example` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
MEDIUMTEXT
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE long_varcharacter_example (
  example LONG VARCHARACTER
);
SHOW CREATE TABLE long_varcharacter_example\G
*************************** 1. row ***************************
       Table: long_varcharacter_example
Create Table: CREATE TABLE `long_varcharacter_example` (
  `example` mediumtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
MEDIUMTEXT
This page is: Copyright © 2025 MariaDB. All rights reserved.
CREATE TABLE national_character_varying_example (
  example NATIONAL CHARACTER VARYING(32)
);
SHOW CREATE TABLE national_character_varying_example\G
*************************** 1. row ***************************
       Table: national_character_varying_example
Create Table: CREATE TABLE `national_character_varying_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
NATIONAL VARCHAR
EXAMPLES

This page is licensed: GPLv2, originally from fill_help_tables.sql

BINARY
CREATE TABLE char_byte_example (
  example CHAR BYTE
);
SHOW CREATE TABLE char_byte_example\G
*************************** 1. row ***************************
       Table: char_byte_example
Create Table: CREATE TABLE `char_byte_example` (
  `example` binary(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
columns depends on the configured maximum packet size in the client/server protocol and available memory. Each
LONGBLOB
value is stored using a four-byte length prefix that indicates the number of bytes in the value.

Oracle Mode

In , BLOB is a synonym for LONGBLOB.

Examples

Note that the maximum size of a LONGBLOB is so large that it cannot be sent to the server without breaking the value up into chunks (something that the command-line client cannot do). For values larger than 16M you can increase the max_allowed_packet size up to a maximum of 1024M to increase the allowed size of non-chunked values.

Data Too Long

When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for LONGBLOB:

See Also

  • BLOB

  • BLOB and TEXT Data Types

  • Data Type Storage Requirements

This page is licensed: GPLv2, originally from fill_help_tables.sql

BLOB
LONGTEXT
columns also depends on the configured maximum packet size in the client/server protocol and available memory. Each
LONGTEXT
value is stored using a four-byte length prefix that indicates the number of bytes in the value.

JSON is an alias for LONGTEXT. See JSON Data Type for details.

Oracle Mode

In , CLOB is a synonym for LONGTEXT.

EXAMPLES

LONGTEXT

Example of LONGTEXT:

The maximum size of a LONGTEXT is so large that it cannot be sent to the server without breaking the value up into chunks (something that the command-line client cannot do). For values larger than 16M, you can increase the max_allowed_packet size up to a maximum of 1024M to increase the allowed size of non-chunked values.

Data Too Long

When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for LONGTEXT:

See Also

  • TEXT

  • BLOB and TEXT Data Types

  • Data Type Storage Requirements

  • JSON Data Type

This page is licensed: GPLv2, originally from fill_help_tables.sql

TEXT

INET4

IPv4 address data type. Stores IPv4 addresses as 4-byte binary strings for efficient storage and retrieval.

INET4 is available from MariaDB 10.10.

Syntax

Description

INET4 is a data type to store IPv4 addresses, as 4-byte binary strings.

Casting from data types to INET6 is permitted, allowing for example comparisons between the two data types, and for INET4 values to be inserted into INET6 columns.

Casting from data types to INET6 is not permitted.

Examples

Casting from INET4 to is permitted, allowing direct inserts.

Comparisons are also permitted:

This page is licensed: CC BY-SA / Gnu FDL

SET Data Type

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.

Syntax

SET('value1','value2',...) [CHARACTER SET charset_name] [COLLATE collation_name]

Description

A set. A string object that can have zero or more values, each of which must be chosen from the list of values 'value1', 'value2', ... A SET column can have a maximum of 64 members. SET values are represented internally as integers.

SET values cannot contain commas.

If a SET contains duplicate values, an error will be returned if is enabled, or a warning if strict mode is not enabled.

EXAMPLES

See Also

This page is licensed: GPLv2, originally from

TINYTEXT

Very small character string. A TINYTEXT column can store up to 255 characters.

Syntax

Description

A TEXT column with a maximum length of 255 (2⁸ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each TINYTEXT value is stored using a one-byte length prefix that indicates the number of bytes in the value.

EXAMPLES

TINYTEXT

Example of TINYTEXT:

Data too Long

When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for TINYTEXT:

See Also

This page is licensed: GPLv2, originally from

TINYBLOB

Very small binary object. A TINYBLOB column can store up to 255 bytes of binary data.

Syntax

Description

A BLOB column with a maximum length of 255 (2⁸ - 1) bytes. Each TINYBLOB value is stored using a one-byte length prefix that indicates the number of bytes in the value.

EXAMPLES

TINYBLOB

Example of TINYBLOB:

Data too Long

When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for TINYBLOB:

See Also

This page is licensed: GPLv2, originally from

RAW

In Oracle mode, RAW is a variable-length binary data type synonymous with VARBINARY.

Overview

See VARBINARY.

EXAMPLES

SET sql_mode='oracle';
CREATE TABLE raw_example (
  example RAW(32)
);
SHOW CREATE TABLE raw_example\G

This page is: Copyright © 2025 MariaDB. All rights reserved.

Unicode

Explore MariaDB's support for Unicode, covering the differences between the utf8mb3 and utf8mb4 character sets for multi-byte storage.

Unicode is a standard for encoding text across multiple writing systems. MariaDB supports a number of character sets for storing Unicode data:

Character Set
Description

ucs2

UCS-2, each character is represented by a 2-byte code with the most significant byte first. Fixed-length 16-bit encoding.

utf8

utf8 is an alias for utf8mb3, but this can changed to ut8mb4 by changing the default value of the system variable.

utf8mb3

UTF-8 encoding using one to three bytes per character. Basic Latin letters, numbers and punctuation use one byte. European and Middle East letters mostly fit into 2 bytes. Korean, Chinese, and Japanese ideographs use 3-bytes. No supplementary characters are stored. Until , this was an alias for utf8. From , utf8 is by default an alias for utf8mb3, but this can changed to ut8mb4 by changing the default value of the system variable.

utf8mb4

Support for the UCA-14.0.0 collations was added in ().

Support for the MySQL 8.0 UCA-9-0-0 (utf8mb4_0900_...) collations will be added to .

This page is licensed: CC BY-SA / Gnu FDL

VARCHARACTER

Variable-length character string type. VARCHARACTER columns store strings of variable length up to a specified maximum (up to 65,535).

Overview

See VARCHAR.

EXAMPLES

CREATE TABLE varcharacter_example (
  example VARCHARACTER(32)
);
SHOW CREATE TABLE varcharacter_example\G

*************************** 1. row ***************************
       Table: varcharacter_example
Create Table: CREATE TABLE `varcharacter_example` (
  `example` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

NATIONAL CHAR VARYING

NATIONAL CHAR VARYING is a synonym for VARCHAR that uses the predefined utf8 character set.

Overview

See NATIONAL VARCHAR.

EXAMPLES

CREATE TABLE national_char_varying_example (
  example NATIONAL CHAR VARYING(32)
);
SHOW CREATE TABLE national_char_varying_example\G
*************************** 1. row ***************************
       Table: national_char_varying_example
Create Table: CREATE TABLE `national_char_varying_example` (
  `example` varchar(32) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This page is: Copyright © 2025 MariaDB. All rights reserved.

Coordinated Universal Time

Coordinated Universal Time (UTC) is the primary time standard by which the world regulates clocks and time, and is the internal storage format for MariaDB timestamp values.

UTC stands for Coordinated Universal Time. It is the world standard for regulating time.

MariaDB stores values internally in UTC, converting them to the required time zone as required.

In general terms it is equivalent to Greenwich Mean Time (GMT), but UTC is used in technical contexts, as it is precisely defined at the subsecond level.

Time zones are offset relative to UTC. For example, time in Tonga is UTC + 13, so 03h00 UTC is 16h00 in Tonga.

See Also

This page is licensed: CC BY-SA / Gnu FDL

BLOB

Variable-length binary large object. BLOB columns can store binary data up to 65,535 bytes, suitable for images or other non-text files.

Syntax

Description

A BLOB column with a maximum length of 65,535 (2¹⁶ - 1) bytes. Each

MEDIUMTEXT

Medium-sized character string. A MEDIUMTEXT column can store up to 16MB of text data.

Syntax

Description

A column with a maximum length of 16,777,215 (2²⁴ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each MEDIUMTEXT

LONGBLOB
CREATE TABLE longblob_example (
   description VARCHAR(20),
   example LONGBLOB
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO longblob_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 4294967295, CHAR(7)));
ERROR 1301 (HY000): Result of rpad() was larger than max_allowed_packet (16777216) - truncated
TRUNCATE longblob_example;

INSERT INTO longblob_example VALUES
   ('Overflow', RPAD('', 4294967296, CHAR(7)));
ERROR 1301 (HY000): Result of rpad() was larger than max_allowed_packet (16777216) - truncated
LONGTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
CREATE TABLE longtext_example (
   description VARCHAR(20),
   example LONGTEXT
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO longtext_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 4294967295, 'x'));
ERROR 1301 (HY000): Result of rpad() was larger than max_allowed_packet (16777216) - truncated
TRUNCATE longtext_example;

INSERT INTO longtext_example VALUES
   ('Overflow', RPAD('', 4294967296, 'x'));
ERROR 1301 (HY000): Result of rpad() was larger than max_allowed_packet (16777216) - truncated
INET4
TINYTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
TINYBLOB
*************************** 1. row ***************************
       Table: raw_example
Create Table: CREATE TABLE "raw_example" (
  "example" varbinary(32) DEFAULT NULL
)
UTC_DATE
UTC_TIME
UTC_TIMESTAMP
INET4
INET4
INET6
strict mode
Character Sets and Collations
Data Type Storage Requirements
fill_help_tables.sql
TEXT
BLOB and TEXT Data Types
Data Type Storage Requirements
fill_help_tables.sql
BLOB
BLOB and TEXT Data Types
Data Type Storage Requirements
fill_help_tables.sql
value is stored using a three-byte length prefix that indicates the number of bytes in the value.

SYNONYMS

The following are synonyms for MEDIUMTEXT:

  • LONG

  • LONG CHAR VARYING

  • LONG CHARACTER VARYING

  • LONG VARCHAR

  • LONG VARCHARACTER

EXAMPLES

MEDIUMTEXT

Example of MEDIUMTEXT:

Data Too Long

When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for MEDIUMTEXT:

See Also

  • TEXT

  • BLOB and TEXT Data Types

  • Data Type Storage Requirements

This page is licensed: GPLv2, originally from fill_help_tables.sql

TEXT
CREATE OR REPLACE TABLE t1 (a INET4);

INSERT INTO t1 VALUES('0.0.0.0'), ('255.10.0.0'), ('255.255.255.255');

INSERT INTO t1 VALUES (0xa0000001);
INSERT INTO t1 VALUES (0xf0000000);
INSERT INTO t1 VALUES (0xff000001);

SELECT HEX(a), a FROM t1 ORDER BY a;
+----------+-----------------+
| HEX(a)   | a               |
+----------+-----------------+
| 00000000 | 0.0.0.0         |
| A0000001 | 160.0.0.1       |
| F0000000 | 240.0.0.0       |
| FF000001 | 255.0.0.1       |
| FF0A0000 | 255.10.0.0      |
| FFFFFFFF | 255.255.255.255 |
+----------+-----------------+
CREATE TABLE t1 (a INET6);

INSERT INTO t1 VALUES('0.0.0.0'), ('255.10.0.0'), ('255.255.255.255');
Query OK, 3 rows affected (0.027 sec)
CREATE OR REPLACE TABLE t1 (i4 INET4, i6 INET6); 
INSERT INTO t1 VALUES('10.10.10.10','::ffff:192.168.0.1');

SELECT LEAST(i4,i6) FROM t1;
+--------------------+
| LEAST(i4,i6)       |
+--------------------+
| ::ffff:10.10.10.10 |
+--------------------+
CREATE TABLE t1 (a INET6);

INSERT INTO t1 VALUES('0.0.0.0'), ('255.10.0.0'), ('255.255.255.255');
ERROR 1292 (22007): Incorrect inet6 value: '0.0.0.0' for column `test`.`t1`.`a` at row 1
CREATE TABLE set_example (
  description VARCHAR(20),
  example SET('Foo', 'Bar', 'Baz', 'Bob')
);
INSERT INTO set_example VALUES
  ('1 val', 'Foo'),
  ('2 vals', 'Baz,Foo'),
  ('4 vals', 'Bob,Foo,Bar,Foo,Baz,Bob');
SELECT * FROM set_example;

+-------------+-----------------+
| description | example         |
+-------------+-----------------+
| 1 val       | Foo             |
| 2 vals      | Foo,Baz         |
| 4 vals      | Foo,Bar,Baz,Bob |
+-------------+-----------------+
CREATE TABLE tinytext_example (
   description VARCHAR(20),
   example TINYTEXT
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO tinytext_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 255, 'x'));
SELECT description, LENGTH(example) AS length FROM tinytext_example;
+---------------------+--------+
| description         | length |
+---------------------+--------+
| Normal foo          |      3 |
| Trailing spaces foo |      9 |
| NULLed              |   NULL |
| Empty               |      0 |
| Maximum             |    255 |
+---------------------+--------+
TRUNCATE tinytext_example;

INSERT INTO tinytext_example VALUES
   ('Overflow', RPAD('', 256, 'x'));
ERROR 1406 (22001): Data too long for column 'example' at row 1
CREATE TABLE tinyblob_example (
   description VARCHAR(20),
   example TINYBLOB
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO tinyblob_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 255, CHAR(7)));
SELECT description, LENGTH(example) AS length
   FROM tinyblob_example;
+---------------------+--------+
| description         | length |
+---------------------+--------+
| Normal foo          |      3 |
| Trailing spaces foo |      9 |
| NULLed              |   NULL |
| Empty               |      0 |
| Maximum             |    255 |
+---------------------+--------+
TRUNCATE tinyblob_example;

INSERT INTO tinyblob_example VALUES
   ('Overflow', RPAD('', 256, CHAR(7)));
ERROR 1406 (22001): Data too long for column 'example' at row 1
MEDIUMTEXT [CHARACTER SET charset_name] [COLLATE collation_name]
CREATE TABLE mediumtext_example (
   description VARCHAR(20),
   example MEDIUMTEXT
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO mediumtext_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 16777215, 'x'));
SELECT description, LENGTH(example) AS length
   FROM mediumtext_example;
+---------------------+----------+
| description         | length   |
+---------------------+----------+
| Normal foo          |        3 |
| Trailing spaces foo |        9 |
| NULLed              |     NULL |
| Empty               |        0 |
| Maximum             | 16777215 |
+---------------------+----------+
TRUNCATE mediumtext_example;

INSERT INTO mediumtext_example VALUES
   ('Overflow', RPAD('', 16777216, 'x'));
ERROR 1406 (22001): Data too long for column 'example' at row 1
BLOB
value is stored using a two-byte length prefix that indicates the number of bytes in the value.

An optional length M can be given for this type. If this is done, MariaDB creates the column as the smallest BLOB type large enough to hold values M bytes long.

BLOB values can also be used to store dynamic columns.

BLOB and TEXT columns can both be assigned a DEFAULT value.

Indexing

On a column that uses the BLOB data type, setting a unique index is now possible.

Note

In previous releases, setting a unique index on a column that uses the BLOB data type was not possible. Index would only guarantee the uniqueness of a fixed number of characters.

Oracle Mode

In , BLOB is a synonym for LONGBLOB.

EXAMPLES

BLOB

Example of BLOB:

Data Too Long

When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for BLOB:

See Also

  • BLOB and TEXT Data Types

  • Data Type Storage Requirements

This page is licensed: GPLv2, originally from fill_help_tables.sql

UTF-8 encoding the same as utf8mb3 but which stores supplementary characters in four bytes.

utf16

UTF-16, same as ucs2, but stores supplementary characters in 32 bits. 16 or 32-bits.

utf32

UTF-32, fixed-length 32-bit encoding.

MDEV-27009
MariaDB 11.4.5
old_mode
MariaDB 10.6
old_mode

BINARY

Fixed-length binary string type. This type stores a fixed number of bytes, padding with zero bytes if the data is shorter.

This page describes the BINARY data type. For details about the operator, see Binary Operator.

Syntax

Description

The BINARY type is similar to the type, but stores binary byte strings rather than non-binary character strings. M represents the column length in bytes.

It contains no character set, and comparison and sorting are based on the numeric value of the bytes.

If the maximum length is exceeded, and is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur.

BINARY values are right-padded with 0x00 (the zero byte) to the specified length when inserted. The padding is not removed on select, so this needs to be taken into account when sorting and comparing, where all bytes are significant. The zero byte, 0x00 is less than a space for comparison purposes.

Examples

Inserting too many characters, first with strict mode off, then with it on:

Sorting is performed with the byte value:

Using to sort as a instead:

The field is a BINARY(10), so padding of two '\0's are inserted, causing comparisons that don't take this into account to fail:

Example of BINARY:

Data Too Long

When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for BINARY:

See Also

This page is licensed: GPLv2, originally from

Locales Plugin

The LOCALES plugin enables the INFORMATION_SCHEMA.LOCALES table and SHOW LOCALES statement, allowing users to view all locales compiled into the server.

The LOCALES plugin creates the LOCALES table in the INFORMATION_SCHEMA database. The plugin also adds the SHOW LOCALES statement.The table and statement can be queried to see all locales that are compiled into the server.

Installing the Plugin

Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.

The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME or . For example:

The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the or the options. This can be specified as a command-line argument to or it can be specified in a relevant server in an . For example:

Uninstalling the Plugin

You can uninstall the plugin dynamically by executing or . For example:

If you installed the plugin by providing the or the options in a relevant server in an , then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.

Example

Options

locales

  • Description: Controls how the server should treat the plugin when the server starts up.

    • Valid values are:

      • OFF - Disables the plugin without removing it from the table.

This page is licensed: CC BY-SA / Gnu FDL

MEDIUMBLOB

Medium-sized binary object. A MEDIUMBLOB column can store up to 16MB of binary data.

Syntax

Description

A BLOB column with a maximum length of 16,777,215 (2²⁴ - 1) bytes. Each MEDIUMBLOB value is stored using a three-byte length prefix that indicates the number of bytes in the value.

LONG VARBINARY is a synonym for MEDIUMBLOB .

EXAMPLES

MEDIUMBLOB

Example of MEDIUMBLOB:

Data Too Long

When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

Example of data too long behavior for MEDIUMBLOB:

See Also

This page is licensed: GPLv2, originally from

JSON Data Type

JSON document storage. While often implemented as an alias for LONGTEXT, this type includes automatic validation to ensure valid JSON format.

The JSON alias was added to make it possible to use JSON columns in from MySQL to MariaDB and to make it possible for MariaDB to read from MySQL.

JSON is an alias for LONGTEXT COLLATE utf8mb4_bin introduced for compatibility reasons with MySQL's JSON data type. MariaDB implements this as a rather, as the JSON data type contradicts the SQL:2016 standard, and MariaDB's benchmarks indicate that performance is at least equivalent.

In order to ensure that a valid json document is inserted, the function can be used as a . This constraint is automatically included for types using the JSON alias.

The assigned text value is retained verbatim. If a value fails JSON_VALID(), an error is raised. This

CHAR

Fixed-length character string type. CHAR columns store strings of a specified length (0 to 255), padding with spaces if necessary.

This page covers the CHAR data type. See for the function.

Syntax

TEXT

Variable-length character string. A TEXT column can store up to 65,535 characters, often used for storing longer text content.

Syntax

Description

A TEXT column with a maximum length of 65,535 (2¹⁶ - 1) characters. The effective maximum length is less if the value contains multi-byte characters. Each

VARBINARY

Variable-length binary string type. VARBINARY columns store binary strings of variable length up to a specified maximum.

Syntax

Description

The VARBINARY type is similar to the

Character Set and Collation Overview

Learn the core concepts of character sets and collations in MariaDB, including how they define string storage and sorting rules.

What are Character Sets and Collations?

A character set is a set of characters, while a collation comprises the rules for comparing and sorting a particular character set.

For example, a subset of a character set could consist of the letters A, B and C. A default collation could define these as appearing in an ascending order of A, B, C

BLOB[(M)]
CREATE TABLE blob_example (
   description VARCHAR(20),
   example BLOB
) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
INSERT INTO blob_example VALUES
   ('Normal foo', 'foo'),
   ('Trailing spaces foo', 'foo      '),
   ('NULLed', NULL),
   ('Empty', ''),
   ('Maximum', RPAD('', 65535, CHAR(7)));
SELECT description, LENGTH(example) AS length
   FROM blob_example;

+---------------------+--------+
| description         | length |
+---------------------+--------+
| Normal foo          |      3 |
| Trailing spaces foo |      9 |
| NULLed              |   NULL |
| Empty               |      0 |
| Maximum             |  65535 |
+---------------------+--------+
TRUNCATE blob_example;

INSERT INTO blob_example VALUES
   ('Overflow', RPAD('', 65536, CHAR(7)));

ERROR 1406 (22001): Data too long for column 'example' at row 1
BINARY(M)
MEDIUMBLOB
CHAR
SQL strict mode
CAST
CHAR
CHAR
Data Type Storage Requirements
fill_help_tables.sql
ON - Enables the plugin. If the plugin cannot be initialized, then the server still continues starting up, but the plugin will be disabled.
  • FORCE - Enables the plugin. If the plugin cannot be initialized, then the server fails to start with an error.

  • FORCE_PLUS_PERMANENT - Enables the plugin. If the plugin cannot be initialized, then the server fails to start with an error. In addition, the plugin cannot be uninstalled with UNINSTALL SONAME or UNINSTALL PLUGIN while the server is running.

  • See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.

  • Command line: --locales=value

  • Data Type: enumerated

  • Default Value: ON

  • Valid Values: OFF, ON, FORCE, FORCE_PLUS_PERMANENT

  • INSTALL PLUGIN
    --plugin-load
    --plugin-load-add
    mysqld
    option group
    option file
    UNINSTALL SONAME
    UNINSTALL PLUGIN
    --plugin-load
    --plugin-load-add
    option group
    option file
    mysql.plugins
    BLOB
    BLOB and TEXT Data Types
    Data Type Storage Requirements
    fill_help_tables.sql
    Description

    A fixed-length string that is always right-padded with spaces to the specified length when stored. M represents the column length in characters. The range of M is 0 to 255. If M is omitted, the length is 1.

    CHAR(0) columns can contain 2 values: an empty string or NULL. Such columns cannot be part of an index. The CONNECT storage engine does not support CHAR(0).

    Note: Trailing spaces are removed when CHAR values are retrieved unless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.

    If a unique index consists of a column where trailing pad characters are stripped or ignored, inserts into that column where values differ only by the number of trailing pad characters will result in a duplicate-key error.

    Examples

    Trailing spaces:

    Example of CHAR:

    Data Too Long

    When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

    Example of data too long behavior for CHAR:

    NO PAD Collations

    NO PAD collations regard trailing spaces as normal characters. You can get a list of all NO PAD collations by querying the Information Schema Collations table, for example:

    See Also

    • CHAR Function

    • VARCHAR

    • BINARY

    • Data Type Storage Requirements

    This page is licensed: GPLv2, originally from fill_help_tables.sql

    CHAR Function
    TEXT
    value is stored using a two-byte length prefix that indicates the number of bytes in the value. If you need a bigger storage, consider using
    instead.

    An optional length M can be given for this type. If this is done, MariaDB creates the column as the smallest TEXT type large enough to hold valuesM characters long.

    BLOB and TEXT columns can be assigned a DEFAULT value.

    Examples

    Trailing spaces:

    Example of TEXT

    Data too Long

    When SQL_MODE is strict (the default) a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

    Example of data too long behavior for TEXT:

    Indexing

    A unique index can be created on a TEXT column.

    Internally, this uses hash indexing to quickly check the values and if a hash collision is found, the actual stored values are compared in order to retain the uniqueness.

    Difference between VARCHAR and TEXT

    • VARCHAR columns can be fully indexed. TEXT columns can only be indexed over a specified length.

    • Using TEXT or BLOB in a SELECT query that uses temporary tables for storing intermediate results will force the temporary table to be disk based (using the Aria storage engine instead of the memory storage engine, which is a bit slower. This is not that bad as the Aria storage engine caches the rows in memory. To get the benefit of this, one should ensure that the aria_pagecache_buffer_size variable is big enough to hold most of the row and index data for temporary tables.

    For Storage Engine Developers

    • Internally the full length of the VARCHAR column is allocated inside each TABLE objects record[] structure. As there are three such buffers, each open table will allocate 3 times max-length-to-store-varchar bytes of memory.

    • TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 bytes length. The TEXT data is only stored once. This means that internally TEXT uses less memory for each open table but instead has the additional overhead that each TEXT object needs to be allocated and freed for each row access (with some caching in between).

    See Also

    • BLOB and TEXT Data Types

    • MEDIUMTEXT

    • Data Type Storage Requirements

    This page is licensed: GPLv2, originally from fill_help_tables.sql

    MEDIUMTEXT
    .

    If we consider different case characters, more complexity is added. A binary collation would evaluate the characters A and a differently, ordering them in a particular way. A case-insensitive collation would evaluate A and a equivalently, while the German phone book collation evaluates the characters ue and ü equivalently.

    A character set can have many collations associated with it, while each collation is only associated with one character set. In MariaDB, the character set name is always part of the collation name. For example, the latin1_german1_ci collation applies only to the latin1 character set. Each character set also has one default collation. The latin1 default collation is latin1_swedish_ci.

    As an example, by default, the character y comes between x and z, while in Lithuanian, it's sorted between i and k. Similarly, the German phone book order is different to the German dictionary order, so while they share the same character set, the collation is different.

    Viewing Character Sets and Collations

    The default character set is utf8mb4 and the default collation is utf8mb4_uca1400_ai_ci. This may differ in some distros, see for example Differences in MariaDB in Debian.

    The default character set is latin1 and the default collation is latin1_swedish_ci. This may differ in some distros, see for example Differences in MariaDB in Debian.

    You can view a full list of character sets and collations supported by MariaDB at Supported Character Sets and Collations, or see what's supported on your server with the SHOW CHARACTER SET and SHOW COLLATION commands.

    By default, A comes before Z, so the following evaluates to true:

    By default, comparisons are case-insensitive:

    Changing Character Sets and Collations

    Character sets and collations can be set from the server level right down to the column level, as well as for client-server communication.

    For example, ue and ü are by default evaluated differently.

    By using the collation_connection system variable to change the connection character set to latin1_german2_ci, or German phone book, the same two characters will evaluate as equivalent.

    See Setting Character Sets and Collations for more.

    This page is licensed: CC BY-SA / Gnu FDL

    CREATE TABLE bins (a BINARY(10));
    
    INSERT INTO bins VALUES('12345678901');
    Query OK, 1 row affected, 1 warning (0.04 sec)
    
    SELECT * FROM bins;
    +------------+
    | a          |
    +------------+
    | 1234567890 |
    +------------+
    
    SET sql_mode='STRICT_ALL_TABLES';
    
    INSERT INTO bins VALUES('12345678901');
    ERROR 1406 (22001): Data too long for column 'a' at row 1
    TRUNCATE bins;
    
    INSERT INTO bins VALUES('A'),('B'),('a'),('b');
    
    SELECT * FROM bins ORDER BY a;
    +------+
    | a    |
    +------+
    | A    |
    | B    |
    | a    |
    | b    |
    +------+
    SELECT * FROM bins ORDER BY CAST(a AS CHAR);
    +------+
    | a    |
    +------+
    | a    |
    | A    |
    | b    |
    | B    |
    +------+
    TRUNCATE bins;
    
    INSERT INTO bins VALUES('12345678');
    
    SELECT a = '12345678', a = '12345678\0\0' from bins;
    +----------------+--------------------+
    | a = '12345678' | a = '12345678\0\0' |
    +----------------+--------------------+
    |              0 |                  1 |
    +----------------+--------------------+
    CREATE TABLE binary_example (
       description VARCHAR(20),
       example BINARY(255)
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    
    INSERT INTO binary_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 255, CHAR(7)));
    
    SELECT description, LENGTH(example) AS length
       FROM binary_example;
    
    +---------------------+--------+
    | description         | length |
    +---------------------+--------+
    | Normal foo          |    255 |
    | Trailing spaces foo |    255 |
    | NULLed              |   NULL |
    | Empty               |    255 |
    | Maximum             |    255 |
    +---------------------+--------+
    TRUNCATE binary_example;
    
    INSERT INTO binary_example VALUES
       ('Overflow', RPAD('', 256, CHAR(7)));
    
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    INSTALL SONAME 'locales';
    [mariadb]
    ...
    plugin_load_add = locales
    UNINSTALL SONAME 'locales';
    SELECT * FROM INFORMATION_SCHEMA.LOCALES;
    +-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+
    | ID  | NAME  | DESCRIPTION                         | MAX_MONTH_NAME_LENGTH | MAX_DAY_NAME_LENGTH | DECIMAL_POINT | THOUSAND_SEP | ERROR_MESSAGE_LANGUAGE |
    +-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+
    |   0 | en_US | English - United States             |                     9 |                   9 | .             | ,            | english                |
    |   1 | en_GB | English - United Kingdom            |                     9 |                   9 | .             | ,            | english                |
    |   2 | ja_JP | Japanese - Japan                    |                     3 |                   3 | .             | ,            | japanese               |
    |   3 | sv_SE | Swedish - Sweden                    |                     9 |                   7 | ,             |              | swedish                |
    |   4 | de_DE | German - Germany                    |                     9 |                  10 | ,             | .            | german                 |
    |   5 | fr_FR | French - France                     |                     9 |                   8 | ,             |              | french                 |
    |   6 | ar_AE | Arabic - United Arab Emirates       |                     6 |                   8 | .             | ,            | english                |
    |   7 | ar_BH | Arabic - Bahrain                    |                     6 |                   8 | .             | ,            | english                |
    |   8 | ar_JO | Arabic - Jordan                     |                    12 |                   8 | .             | ,            | english                |
    ...
    | 106 | no_NO | Norwegian - Norway                  |                     9 |                   7 | ,             | .            | norwegian              |
    | 107 | sv_FI | Swedish - Finland                   |                     9 |                   7 | ,             |              | swedish                |
    | 108 | zh_HK | Chinese - Hong Kong SAR             |                     3 |                   3 | .             | ,            | english                |
    | 109 | el_GR | Greek - Greece                      |                    11 |                   9 | ,             | .            | greek                  |
    | 110 | rm_CH | Romansh - Switzerland               |                     9 |                   9 | ,             | .            | english                |
    +-----+-------+-------------------------------------+-----------------------+---------------------+---------------+--------------+------------------------+
    CREATE TABLE mediumblob_example (
       description VARCHAR(20),
       example MEDIUMBLOB
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    INSERT INTO mediumblob_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 16777215, CHAR(7)));
    SELECT description, LENGTH(example) AS length
       FROM mediumblob_example;
    +---------------------+----------+
    | description         | length   |
    +---------------------+----------+
    | Normal foo          |        3 |
    | Trailing spaces foo |        9 |
    | NULLed              |     NULL |
    | Empty               |        0 |
    | Maximum             | 16777215 |
    +---------------------+----------+
    TRUNCATE mediumblob_example;
    INSERT INTO mediumblob_example VALUES
       ('Overflow', RPAD('', 16777216, CHAR(7)));
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    [NATIONAL] CHAR[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]
    CREATE TABLE strtest (c CHAR(10));
    INSERT INTO strtest VALUES('Maria   ');
    
    SELECT c='Maria',c='Maria   ' FROM strtest;
    +-----------+--------------+
    | c='Maria' | c='Maria   ' |
    +-----------+--------------+
    |         1 |            1 |
    +-----------+--------------+
    
    SELECT c LIKE 'Maria',c LIKE 'Maria   ' FROM strtest;
    +----------------+-------------------+
    | c LIKE 'Maria' | c LIKE 'Maria   ' |
    +----------------+-------------------+
    |              1 |                 0 |
    +----------------+-------------------+
    CREATE TABLE char_example (
       description VARCHAR(20),
       example CHAR(255)
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    INSERT INTO char_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 255, 'x'));
    SELECT description, LENGTH(example) AS length FROM char_example;
    
    +---------------------+--------+
    | description         | length |
    +---------------------+--------+
    | Normal foo          |      3 |
    | Trailing spaces foo |      3 |
    | NULLed              |   NULL |
    | Empty               |      0 |
    | Maximum             |    255 |
    +---------------------+--------+
    TRUNCATE char_example;
    
    INSERT INTO char_example VALUES
       ('Overflow', RPAD('', 256, 'x'));
    
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    SELECT collation_name FROM information_schema.collations 
      WHERE collation_name LIKE "%nopad%";  
    +------------------------------+
    | collation_name               |
    +------------------------------+
    | big5_chinese_nopad_ci        |
    | big5_nopad_bin               |
    ...
    TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]
    CREATE TABLE strtest (d TEXT(10));
    INSERT INTO strtest VALUES('Maria   ');
    
    SELECT d='Maria',d='Maria   ' FROM strtest;
    +-----------+--------------+
    | d='Maria' | d='Maria   ' |
    +-----------+--------------+
    |         1 |            1 |
    +-----------+--------------+
    
    SELECT d LIKE 'Maria',d LIKE 'Maria   ' FROM strtest;
    +----------------+-------------------+
    | d LIKE 'Maria' | d LIKE 'Maria   ' |
    +----------------+-------------------+
    |              0 |                 1 |
    +----------------+-------------------+
    CREATE TABLE text_example (
       description VARCHAR(20),
       example TEXT
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    INSERT INTO text_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 65535, 'x'));
    SELECT description, LENGTH(example) AS length
       FROM text_example;
    +---------------------+--------+
    | description         | length |
    +---------------------+--------+
    | Normal foo          |      3 |
    | Trailing spaces foo |      9 |
    | NULLed              |   NULL |
    | Empty               |      0 |
    | Maximum             |  65535 |
    +---------------------+--------+
    TRUNCATE text_example;
    
    INSERT INTO text_example VALUES
       ('Overflow', RPAD('', 65536, 'x'));
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    SELECT "A" < "Z";
    +-----------+
    | "A" < "Z" |
    +-----------+
    |         1 |
    +-----------+
    SELECT "A" < "a", "A" = "a";
    +-----------+-----------+
    | "A" < "a" | "A" = "a" |
    +-----------+-----------+
    |         0 |         1 |
    +-----------+-----------+
    SELECT 'Mueller' = 'Müller';
    +----------------------+
    | 'Müller' = 'Mueller' |
    +----------------------+
    |                    0 |
    +----------------------+
    SET collation_connection = latin1_german2_ci;
    
    SELECT 'Mueller' = 'Müller';
    +-----------------------+
    | 'Mueller' = 'Müller'  |
    +-----------------------+
    |                     1 |
    +-----------------------+
    CHECK
    constraint can also be manually added to any
    LONGTEXT
    field. When a JSON object contains duplicate keys, only the first key-value pair is accessible via functions like
    JSON_EXTRACT()
    .

    Examples

    With validation:

    JSON example:

    Replicating JSON Data Between MySQL and MariaDB

    The JSON type in MySQL stores the JSON object in a compact form, not as LONGTEXT as in MariaDB. This means that row-based replication will not work for JSON types from MySQL to MariaDB.

    There are a few different ways to solve this:

    • Use statement-based replication.

    • Change the JSON column to type TEXT in MySQL.

    • If you must use row-based replication and cannot change the MySQL master from JSON to TEXT, you can try to introduce an intermediate MySQL replica, and change the column type from JSON to TEXT on it. Then you replicate from this intermediate slave to MariaDB.

    Converting a MySQL TABLE with JSON Fields to MariaDB

    MariaDB can't directly access MySQL's JSON format.

    There are a few different ways to move the table to MariaDB:

    • From , you can use the mysql_json plugin. See Making MariaDB understand MySQL JSON (blog post).

    • Change the JSON column to type TEXT in MySQL. After this, MariaDB can directly use the table without any need for a dump and restore.

    • Use mysqldump to copy the table.

    Differences Between MySQL JSON Strings and MariaDB JSON Strings

    • In MySQL, JSON is an object and is compared according to json values. In MariaDB JSON strings are normal strings and compared as strings. One exception is when using JSON_EXTRACT() in which case strings are unescaped before comparison.

    See Also

    • JSON Functions

    • CONNECT JSON Table Type

    • MDEV-9144

    This page is licensed: CC BY-SA / Gnu FDL

    statement based
    replication
    mysqldumps
    LONGTEXT
    JSON_VALID
    CHECK constraint
    type, but stores binary byte strings rather than non-binary character strings. M represents the maximum column length in bytes.

    It contains no character set, and comparison and sorting are based on the numeric value of the bytes.

    If the maximum length is exceeded, and SQL strict mode is not enabled , the extra characters will be dropped with a warning. If strict mode is enabled, an error will occur.

    Unlike BINARY values, VARBINARY values are not right-padded when inserting.

    Oracle Mode

    In , RAW is a synonym for VARBINARY.

    Examples

    Inserting too many characters, first with strict mode off, then with it on:

    Sorting is performed with the byte value:

    Using CAST to sort as a CHAR instead:

    VARBINARY

    For our example of VARBINARY, we picked a maximum size that avoids overflowing the maximum row size (65535). Keep in mind that a multi-byte character set would need more space in the row than a single-byte character set. We also avoid the auto-conversion of a VARBINARY into a BLOB, MEDIUMBLOB, or LONGBLOB that can happen when STRICT_TRANS_TABLES is not set in the SQL_MODE.

    The example:

    Data too Long

    When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

    Example of data too long behavior for VARBINARY:

    See Also

    • VARCHAR

    • Data Type Storage Requirements

    This page is licensed: GPLv2, originally from fill_help_tables.sql

    VARCHAR

    ENUM

    String object with a value chosen from a predefined list. An ENUM column allows only one value selected from a list of permitted strings.

    Syntax

    Description

    An enumeration. A string object that can have only one value, chosen from the list of values 'value1', 'value2', ..., NULL or the special '' error value. In theory, an ENUM column can have a maximum of 65,535 distinct values; in practice, the real maximum depends on many factors. ENUM values are represented internally as integers.

    Trailing spaces are automatically stripped from ENUM values on table creation.

    ENUM values require relatively little storage space compared to strings, either one or two bytes depending on the number of enumeration values.

    NULL and empty values

    An ENUM can also contain NULL and empty values. If the ENUM column is declared to permit NULL values, NULL becomes a valid value, as well as the default value (see below). If is not enabled, and an invalid value is inserted into an ENUM, a special empty string, with an index value of zero (see Numeric index, below), is inserted, with a warning. This may be confusing, because the empty string is also a possible value, and the only difference if that is this case its index is not 0. Inserting will fail with an error if strict mode is active.

    If a DEFAULT clause is missing, the default value will be:

    • NULL if the column is nullable;

    • otherwise, the first value in the enumeration.

    Numeric index

    ENUM values are indexed numerically in the order they are defined, and sorting will be performed in this numeric order. We suggest not using ENUM to store numerals, as there is little to no storage space benefit, and it is easy to confuse the enum integer with the enum numeral value by leaving out the quotes.

    An ENUM defined as ENUM('apple','orange','pear') would have the following index values:

    Index
    Value

    Examples

    Selecting by numeric index:

    Sorting is according to the index value:

    It's easy to get confused between returning the enum integer with the stored value, so we don't suggest using ENUM to store numerals. The first example returns the 1st indexed field ('2' has an index value of 1, as it's defined first), while the second example returns the string value '1'.

    Example of ENUM:

    See Also

    This page is licensed: GPLv2, originally from

    LONG VARBINARY

    LONG VARBINARY is a compatibility synonym for the MEDIUMBLOB binary data type.

    Overview

    See MEDIUMBLOB.

    EXAMPLES

    CREATE TABLE long_varbinary_example (
      example LONG VARBINARY
    );
    SHOW CREATE TABLE long_varbinary_example\G
    *************************** 1. row ***************************
           Table: long_varbinary_example
    Create Table: CREATE TABLE `long_varbinary_example` (
      `example` mediumblob DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1

    This page is: Copyright © 2025 MariaDB. All rights reserved.

    UUID Data Type

    Universally Unique Identifier data type. This type is optimized for storing 128-bit UUID values efficiently.

    UUID is available from MariaDB 10.7.

    Syntax

    Setting the Language for Error Messages

    Learn how to configure the lc_messages and lc_messages_dir system variables to display server error messages in a supported local language.

    MariaDB server error messages are by default in English. However, MariaDB server also supports error message in many different languages. Each supported language has its own version of the called errmsg.sys in a dedicated directory for that language.

    Supported Languages for Error Messages

    Error message localization is supported for the following languages:

    VARCHAR2

    Variable-length character string type. VARCHAR2 columns store strings of variable length up to a specified maximum (up to 65,535).

    Overview

    This is a synonym for .

    EXAMPLES

    CREATE TABLE t (j JSON);
    
    DESC t;
    +-------+----------+------+-----+---------+-------+
    | Field | Type     | Null | Key | Default | Extra |
    +-------+----------+------+-----+---------+-------+
    | j     | longtext | YES  |     | NULL    |       |
    +-------+----------+------+-----+---------+-------+
    CREATE TABLE t2 (
      j JSON 
      CHECK (JSON_VALID(j))
    );
    
    INSERT INTO t2 VALUES ('invalid');
    ERROR 4025 (23000): CONSTRAINT `j` failed for `test`.`t2`
    
    INSERT INTO t2 VALUES ('{"id": 1, "name": "Monty"}');
    Query OK, 1 row affected (0.13 sec)
    CREATE TABLE json_example (
      description VARCHAR(20),
      example JSON
    );
    SHOW CREATE TABLE json_example\G
    *************************** 1. row ***************************
           Table: json_example
    Create Table: CREATE TABLE `json_example` (
      `description` varchar(20) DEFAULT NULL,
      `example` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`example`))
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
    INSERT INTO json_example VALUES
      ('Array', '[ 1, 2, 3 ]'),
      ('Dictionary', '{ "a": 1, "b": 2 }'),
      ('Duplicates', '{ "a":1,"b":2, "a":3,"b": 4,"b":5}');
    SELECT * FROM json_example;
    +-------------+------------------------------------+
    | description | example                            |
    +-------------+------------------------------------+
    | Array       | [ 1, 2, 3 ]                        |
    | Dictionary  | { "a": 1, "b": 2 }                 |
    | Duplicates  | { "a":1,"b":2, "a":3,"b": 4,"b":5} |
    +-------------+------------------------------------+
    SELECT description, JSON_EXTRACT(example, '$.b')
    FROM json_example;
    +-------------+------------------------------+
    | description | JSON_EXTRACT(example, '$.b') |
    +-------------+------------------------------+
    | Array       | NULL                         |
    | Dictionary  | 2                            |
    | Duplicates  | 2                            |
    +-------------+------------------------------+
    INSERT INTO json_example VALUES
      ('Invalid', '{');
    ERROR 4025 (23000): CONSTRAINT `json_example.example` failed for `test`.`json_example`
    VARBINARY(M)
    CREATE TABLE varbins (a VARBINARY(10));
    
    INSERT INTO varbins VALUES('12345678901');
    Query OK, 1 row affected, 1 warning (0.04 sec)
    
    SELECT * FROM varbins;
    +------------+
    | a          |
    +------------+
    | 1234567890 |
    +------------+
    
    SET sql_mode='STRICT_ALL_TABLES';
    
    INSERT INTO varbins VALUES('12345678901');
    ERROR 1406 (22001): Data too long for column 'a' at row 1
    TRUNCATE varbins;
    
    INSERT INTO varbins VALUES('A'),('B'),('a'),('b');
    
    SELECT * FROM varbins ORDER BY a;
    +------+
    | a    |
    +------+
    | A    |
    | B    |
    | a    |
    | b    |
    +------+
    SELECT * FROM varbins ORDER BY CAST(a AS CHAR);
    +------+
    | a    |
    +------+
    | a    |
    | A    |
    | b    |
    | B    |
    +------+
    CREATE TABLE varbinary_example (
       description VARCHAR(20),
       example VARBINARY(65511)
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    INSERT INTO varbinary_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 65511, CHAR(7)));
    SELECT description, LENGTH(example) AS length
       FROM varbinary_example;
    +---------------------+--------+
    | description         | length |
    +---------------------+--------+
    | Normal foo          |      3 |
    | Trailing spaces foo |      9 |
    | NULLed              |   NULL |
    | Empty               |      0 |
    | Maximum             |  65511 |
    +---------------------+--------+
    TRUNCATE varbinary_example;
    
    INSERT INTO varbinary_example VALUES
       ('Overflow', RPAD('', 65512, CHAR(7)));
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    ENUM('value1','value2',...) [CHARACTER SET charset_name] [COLLATE collation_name]

    NULL

    NULL

    0

    ''

    1

    'apple'

    2

    'orange'

    3

    'pear'

    strict SQL Mode
    Data Type Storage Requirements
    fill_help_tables.sql
    This page is: Copyright © 2025 MariaDB. All rights reserved.
    SET sql_mode='oracle';
    
    CREATE TABLE varchar2_example (
      example VARCHAR2(32)
    );
    SHOW CREATE TABLE varchar2_example\G
    *************************** 1. row ***************************
           Table: varchar2_example
    Create Table: CREATE TABLE "varchar2_example" (
      "example" varchar(32) DEFAULT NULL
    )
    VARCHAR
    CREATE TABLE fruits (
      id INT NOT NULL auto_increment PRIMARY KEY,
      fruit ENUM('apple','orange','pear'),
      bushels INT);
    
    DESCRIBE fruits;
    +---------+-------------------------------+------+-----+---------+----------------+
    | Field   | Type                          | Null | Key | Default | Extra          |
    +---------+-------------------------------+------+-----+---------+----------------+
    | id      | int(11)                       | NO   | PRI | NULL    | auto_increment |
    | fruit   | enum('apple','orange','pear') | YES  |     | NULL    |                |
    | bushels | int(11)                       | YES  |     | NULL    |                |
    +---------+-------------------------------+------+-----+---------+----------------+
    
    INSERT INTO fruits
        (fruit,bushels) VALUES
        ('pear',20),
        ('apple',100),
        ('orange',25);
    
    INSERT INTO fruits
        (fruit,bushels) VALUES
        ('avocado',10);
    ERROR 1265 (01000): Data truncated for column 'fruit' at row 1
    
    SELECT * FROM fruits;
    +----+--------+---------+
    | id | fruit  | bushels |
    +----+--------+---------+
    |  1 | pear   |      20 |
    |  2 | apple  |     100 |
    |  3 | orange |      25 |
    +----+--------+---------+
    SELECT * FROM fruits WHERE fruit=2;
    +----+--------+---------+
    | id | fruit  | bushels |
    +----+--------+---------+
    |  3 | orange |      25 |
    +----+--------+---------+
    CREATE TABLE enums (a ENUM('2','1'));
    
    INSERT INTO enums VALUES ('1'),('2');
    
    SELECT * FROM enums ORDER BY a ASC;
    +------+
    | a    |
    +------+
    | 2    |
    | 1    |
    +------+
    SELECT * FROM enums WHERE a=1;
    +------+
    | a    |
    +------+
    | 2    |
    +------+
    
    SELECT * FROM enums WHERE a='1';
    +------+
    | a    |
    +------+
    | 1    |
    +------+
    CREATE TABLE enum_example (
      description VARCHAR(20),
      example ENUM('Alpha', 'Beta', 'Gamma', 'RC', 'Stable')
    );
    INSERT INTO enum_example VALUES
      ('foo', 'Beta'),
      ('bar', 'RC'),
      ('baz', 'Alpha'),
      ('bob', 5);
    SELECT * FROM enum_example;
    
    +-------------+---------+
    | description | example |
    +-------------+---------+
    | foo         | Beta    |
    | bar         | RC      |
    | baz         | Alpha   |
    | bob         | Stable  |
    +-------------+---------+
    Description

    The UUID data type is intended for the storage of 128-bit UUID (Universally Unique Identifier) data. See the UUID function page for more details on UUIDs themselves.

    Retrieval

    Data retrieved by this data type is in the string representation defined in RFC4122.

    Casting

    String literals of hexadecimal characters and CHAR/VARCHAR/TEXT can be cast to the UUID data type. Likewise hexadecimal literals, binary-literals, and BINARY/VARBINARY/BLOB types can also be cast to UUID.

    The data type will not accept a short UUID generated with the UUID_SHORT function, but will accept a value without the - character generated by the SYS_GUID function (or inserted directly). Hyphens can be partially omitted as well, or included after any group of two digits.

    The type does not accept UUID values in braces, permitted by some implementations.

    Storage

    UUID values are stored in an index-friendly manner; the order of a UUID of llllllll-mmmm-Vhhh-vsss-nnnnnnnnnnnn is stored as:

    This provides a sorting order, assuming a UUIDv1 (node and timestamp) is used, of the node, followed by the timestamp. The key aspect is the timestamps are sequential.

    MariaDB starting with

    Taking into account that UUIDv7 and other versions are designed around time ordering, UUID values version >= 6 are stored without byte-swapping, and UUID values with version >=8 and variant=0 are now considered invalid (as the SQL standard suggests).

    UUID values version >= 6 are not stored without byte-swapping, and UUID values with version >=8 and variant=0 are not considered invalid.

    Examples

    Directly inserting via string literals:

    Directly Inserting via hexadecimal literals:

    Generating and inserting via the UUID function.

    Retrieval:

    The UUID_SHORT function does not generate valid full-length UUID:

    Accepting a value without the - character, either directly or generated by the SYS_GUID function:

    Valid and invalid hyphen and brace usage:

    See Also

    • 10.7 preview feature: UUID Data Type (mariadb.org blog post)

    • UUID function for generating v1 UUIDs

    • UUID function for generating v4 UUIDs

    • UUID function for generating v7 UUIDs

    • - UUID without the - character for Oracle compatibility

    This page is licensed: CC BY-SA / Gnu FDL

    Bulgarian

  • Chinese (from , , 10.6.8, , )

  • Czech

  • Danish

  • Dutch

  • English

  • Estonian

  • French

  • Georgian (from MariaDB 10.11.3)

  • German

  • Greek

  • Hindi

  • Hungarian

  • Italian

  • Japanese

  • Korean

  • Norwegian

  • Norwegian-ny (Nynorsk)

  • Polish

  • Portuguese

  • Romanian

  • Russian

  • Serbian

  • Slovak

  • Spanish

  • Swahili (from )

  • Swedish

  • Ukrainian

  • Setting the lc_messages and lc_messages_dir System Variables

    The lc_messages and lc_messages_dir system variables can be used to set the server locale used for error messages.

    The lc_messages system variable can be specified as a locale name. The language of the associated locale will be used for error messages. See Server Locales for a list of supported locales and their associated languages.

    The lc_messages system variable is set to en_US by default, which means that error messages are in English by default.

    If the lc_messages system variable is set to a valid locale name, but the server can't find an error message file for the language associated with the locale, then the default language will be used instead.

    This system variable can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file. For example:

    The lc_messages system variable can also be changed dynamically with SET GLOBAL. For example:

    If a server has the lc_messages system variable set to the fr_CA locale like the above example, then error messages would be in French. For example:

    The lc_messages_dir system variable can be specified either as the path to the directory storing the server's error message files or as the path to the directory storing the specific language's error message file.

    The server initially tries to interpret the value of the lc_messages_dir system variable as a path to the directory storing the server's error message files. Therefore, it constructs the path to the language's error message file by concatenating the value of the lc_messages_dir system variable with the language name of the locale specified by the lc_messages system variable .

    If the server does not find the error message file for the language, then it tries to interpret the value of the lc_messages_dir system variable as a direct path to the directory storing the specific language's error message file.

    This system variable can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file.

    For example, to specify the path to the directory storing the server's error message files:

    Or to specify the path to the directory storing the specific language's error message file:

    The lc_messages_dir system variable can not be changed dynamically.

    Setting the --language Option

    The --language option can also be used to set the server's language for error messages, but it is deprecated. It is recommended to set the lc_messages system variable instead.

    The --language option can be specified either as a language name or as the path to the directory storing the language's error message file. See Server Locales for a list of supported locales and their associated languages.

    This option can be specified as command-line arguments to mariadbd or it can be specified in a relevant server option group in an option file.

    For example, to specify a language name:

    Or to specify the path to the directory storing the language's error message file:

    Character Set

    The character set that the error messages are returned in is determined by the character_set_results variable, which defaults to UTF8.

    This page is licensed: CC BY-SA / Gnu FDL

    localization
    error message file

    Time Zones

    Manage time zone settings in MariaDB, including the global server time zone, session time zone, and system time zone configurations.

    MariaDB keeps track of several time zone settings.

    Setting the Time Zone

    The system variable is the primary way to set the time zone. It can be specified in one of the following formats:

    • The default value is SYSTEM

    VARCHAR

    Variable-length character string type. VARCHAR columns store strings of variable length up to a specified maximum (up to 65,535).

    Syntax

    Description

    A variable-length string. M represents the maximum column length in characters. The range of M is 0 to 65,532. The effective maximum length of a VARCHAR

    UUID
    nnnnnnnnnnnn-vsss-Vhhh-mmmm-llllllll
    CREATE TABLE t1 (id UUID);
    INSERT INTO t1 VALUES('123e4567-e89b-12d3-a456-426655440000');
    INSERT INTO t1 VALUES (x'fffffffffffffffffffffffffffffffe');
    INSERT INTO t1 VALUES (UUID());
    SELECT * FROM t1;
    +--------------------------------------+
    | id                                   |
    +--------------------------------------+
    | 123e4567-e89b-12d3-a456-426655440000 |
    | ffffffff-ffff-ffff-ffff-fffffffffffe |
    | 93aac041-1a14-11ec-ab4e-f859713e4be4 |
    +--------------------------------------+
    INSERT INTO t1 VALUES (UUID_SHORT());
    ERROR 1292 (22007): Incorrect uuid value: '99440417627439104' 
      for column `test`.`t1`.`id` at row 1
    INSERT INTO t1 VALUES (SYS_GUID());
    
    SELECT * FROM t1;
    +--------------------------------------+
    | id                                   |
    +--------------------------------------+
    | 123e4567-e89b-12d3-a456-426655440000 |
    | ffffffff-ffff-ffff-ffff-fffffffffffe |
    | 93aac041-1a14-11ec-ab4e-f859713e4be4 |
    | ea0368d3-1a14-11ec-ab4e-f859713e4be4 |
    +--------------------------------------+
    
    SELECT SYS_GUID();
    +----------------------------------+
    | SYS_GUID()                       |
    +----------------------------------+
    | ff5b6bcc1a1411ecab4ef859713e4be4 |
    +----------------------------------+
    
    INSERT INTO t1 VALUES ('ff5b6bcc1a1411ecab4ef859713e4be4');
    
    SELECT * FROM t1;
    +--------------------------------------+
    | id                                   |
    +--------------------------------------+
    | 123e4567-e89b-12d3-a456-426655440000 |
    | ffffffff-ffff-ffff-ffff-fffffffffffe |
    | 93aac041-1a14-11ec-ab4e-f859713e4be4 |
    | ea0368d3-1a14-11ec-ab4e-f859713e4be4 |
    | ff5b6bcc-1a14-11ec-ab4e-f859713e4be4 |
    +--------------------------------------+
    TRUNCATE t1;
    
    INSERT INTO t1 VALUES ('f8aa-ed66-1a1b-11ec-ab4e-f859-713e-4be4');
    
    INSERT INTO t1 VALUES ('1b80667f1a1c-11ecab4ef859713e4be4');
    
    INSERT INTO t1 VALUES ('2fd6c945-1a-1c-11ec-ab4e-f859713e4be4');
    
    INSERT INTO t1 VALUES ('49-c9-f9-59-1a-1c-11ec-ab4e-f859713e4be4');
    
    INSERT INTO t1 VALUES ('57-96-da-c1-1a-1c-11-ec-ab-4e-f8-59-71-3e-4b-e4');
    
    INSERT INTO t1 VALUES ('6-eb74f8f-1a1c-11ec-ab4e-f859713e4be4');
    
    INSERT INTO t1 VALUES ('{29bad136-1a1d-11ec-ab4e-f859713e4be4}');
    ERROR 1292 (22007): Incorrect uuid value: '{29bad136-1a1d-11ec-ab4e-f859713e4be4}' 
      for column `test`.`t1`.`id` at row 1
    
    SELECT * FROM t1;
    +--------------------------------------+
    | id                                   |
    +--------------------------------------+
    | f8aaed66-1a1b-11ec-ab4e-f859713e4be4 |
    | 1b80667f-1a1c-11ec-ab4e-f859713e4be4 |
    | 2fd6c945-1a1c-11ec-ab4e-f859713e4be4 |
    | 49c9f959-1a1c-11ec-ab4e-f859713e4be4 |
    | 5796dac1-1a1c-11ec-ab4e-f859713e4be4 |
    | 6eb74f8f-1a1c-11ec-ab4e-f859713e4be4 |
    +--------------------------------------+
    [mariadb]
    ...
    lc_messages=fr_CA
    SET GLOBAL lc_messages='fr_CA';
    SELECT blah;
    ERROR 1054 (42S22): Champ 'blah' inconnu dans field list
    [mariadb]
    ...
    lc_messages_dir=/usr/share/mysql/
    [mariadb]
    ...
    lc_messages_dir=/usr/share/mysql/french/
    [mariadb]
    ...
    language=french
    [mariadb]
    ...
    language=/usr/share/mysql/french/
    , which indicates that the system time zone defined in the
    system variable will be used. Note that if you are using SYSTEM with replication in either statement or mixed mode, you MUST use the same value for system_time_zone on all replicas (otherwise TIMESTAMP columns will not replicate correctly). See
    below for more information.
  • An offset from Coordinated Universal Time (UTC), such as +5:00 or -9:00, can also be used.

  • If the time zone tables in the mysql database were loaded, then a named time zone, such as America/New_York, Africa/Johannesburg, or Europe/Helsinki, is also permissible. See mysql Time Zone Tables below for more information.

  • There are two time zone settings that can be set within MariaDB--the global server time zone, and the time zone for your current session. There is also a third time zone setting which may be relevant--the system time zone.

    Global Server Time Zone

    The global server time zone can be changed at server startup by setting the --default-time-zone option either on the command-line or in a server option group in an option file. For example:

    The global server time zone can also be changed dynamically by setting the time_zone system variable as a user account that has the SUPER privilege. For example:

    The current global server time zone can be viewed by looking at the global value of the time_zone system variable. For example:

    Session Time Zone

    Each session that connects to the server will also have its own time zone. This time zone is initially inherited from the global value of the time_zone system variable, which sets the session value of the same variable.

    A session's time zone can be changed dynamically by setting the time_zone system variable. For example:

    The current session time zone can be viewed by looking at the session value of the time_zone system variable. For example:

    System Time Zone

    The system time zone is determined when the server starts, and it sets the value of the system_time_zone system variable. The system time zone is usually read from the operating system's environment. You can change the system time zone in several different ways, such as:

    • If you are starting the server with mariadbd-safe, then you can set the system time zone with the --timezone option either on the command-line or in the [mariadbd-safe] option group in an option file. For example:

    • If you are using a Unix-like operating system, then you can set the system time zone by setting the TZ environment variable in your shell before starting the server. For example:

    • On some Linux operating systems, you can change the default time zone for the whole system by making the /etc/localtime symbolic link point to the desired time zone. For example:

    • On some Debian-based Linux operating systems, you can change the default time zone for the whole system by executing the following:

    • On Linux operating systems that use systemd, you can change the default time zone for the whole system by using the timedatectl utility. For example:

    Time Zone Effects

    Time Zone Effects on Functions

    Some functions are affected by the time zone settings. These include:

    • NOW()

    • SYSDATE()

    • CURDATE()

    • CURTIME()

    Some functions are not affected. These include:

    • UTC_DATE()

    • UTC_TIME()

    • UTC_TIMESTAMP()

    Time Zone Effects on Data Types

    Some data types are affected by the time zone settings.

    • TIMESTAMP - See TIMESTAMP: Time Zones for information on how this data type is affected by time zones.

    • DATETIME - See DATETIME: Time Zones for information on how this data type is affected by time zones.

    mysql Time Zone Tables

    The mysql database contains a number of time zone tables:

    • time_zone

    • time_zone_leap_second

    • time_zone_name

    • time_zone_transition

    By default, these time zone tables in the mysql database are created, but not populated.

    If you are using a Unix-like operating system, then you can populate these tables using the mariadb-tzinfo-to-sql utility, which uses the zoneinfo data available on Linux, Mac OS X, FreeBSD and Solaris.

    If you are using Windows, then you will need to import pre-populated time zone tables. These are available at MariaDB mirrors.

    Time zone data needs to be updated on occasion. When that happens, the time zone tables may need to be reloaded.

    See Also

    • LinuxJedi in Spacetime: Properly Handling Time and Date (video)

    This page is licensed: CC BY-SA / Gnu FDL

    time_zone
    system_time_zone
    System Time Zone
    is subject to the maximum row size and the character set used. For example, utf-8 characters can require up to three bytes per character, so a
    VARCHAR
    column that uses the utf-8 character set can be declared to be a maximum of 21,844 characters.

    Note:

    For the engine, M represents the maximum column length in bytes.

    MariaDB stores VARCHAR values as a one-byte or two-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A VARCHAR column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes.

    MariaDB follows the standard SQL specification and does not remove trailing spaces from VARCHAR values.

    VARCHAR(0) columns can contain 2 values: an empty string or NULL. Such columns cannot be part of an index. The CONNECT storage engine does not support VARCHAR(0).

    VARCHAR is shorthand for CHARACTER VARYING. NATIONAL VARCHAR is the standard SQL way to define that a VARCHAR column should use some predefined character set. MariaDB uses utf-8 as its predefined character set, as does MySQL. NVARCHAR is shorthand for NATIONAL VARCHAR.

    For MariaDB, a number of NO PAD collations are available.

    If a unique index consists of a column where trailing pad characters are stripped or ignored, inserts into that column where values differ only by the number of trailing pad characters will result in a duplicate-key error.

    SYNONYMS

    The following are synonyms for VARCHAR:

    • CHAR VARYING

    • CHARACTER VARYING

    • VARCHAR2

    • VARCHARACTER

    Examples

    The following are equivalent:

    Trailing spaces

    VARCHAR

    For our example of VARCHAR, we picked a maximum size that avoids overflowing the maximum row size (65535). Keep in mind that a multi-byte character set would need more space in the row than a single-byte character set. We also avoid the auto-conversion of a VARCHAR into a TEXT, MEDIUMTEXT, or LONGTEXT that can happen when STRICT_TRANS_TABLES is not set in the SQL_MODE.

    The example:

    Data too Long

    When SQL_MODE is strict (the default), a value is considered "too long" when its length exceeds the size of the data type, and an error is generated.

    Example of data too long behavior for VARCHAR:

    Truncation

    • Depending on whether or not strict sql mode is set, you will either get a warning or an error if you try to insert a string that is too long into a VARCHAR column. If the extra characters are spaces, the spaces that can't fit will be removed, and you will always get a warning, regardless of the sql mode setting.

    Difference Between VARCHAR and TEXT

    • VARCHAR columns can be fully indexed. TEXT columns can only be indexed over a specified length.

    • Using TEXT or BLOB in a SELECT query that uses temporary tables for storing intermediate results will force the temporary table to be disk-based (using the Aria storage engine instead of the memory storage engine, which is a bit slower. This is not that bad, as the Aria storage engine caches the rows in memory. To get the benefit of this, one should ensure that the aria_pagecache_buffer_size variable is big enough to hold most of the row and index data for temporary tables.

    Oracle Mode

    In , VARCHAR2 is a synonym.

    For Storage Engine Developers

    • Internally, the full length of the VARCHAR column is allocated inside each TABLE objects record[] structure. As there are three such buffers, each open table will allocate 3 times the max-length-to-store-varchar bytes of memory.

    • TEXT and BLOB columns are stored with a pointer (4 or 8 bytes) + a 1-4 byte length. The TEXT data is only stored once. This means that internally TEXT uses less memory for each open table but instead has the additional overhead that each TEXT object needs to be allocated and freed for each row access (with some caching in between).

    See Also

    • VARBINARY

    • TEXT

    • CHAR

    • Character Sets and Collations

    This page is licensed: GPLv2, originally from fill_help_tables.sql

    UUID_SHORT function
    SYS_GUID

    ROW

    ROW is a data type used in stored programs to store a complete row of data from a cursor or table.

    Syntax

    Description

    ROW is a data type for stored procedure variables.

    Features

    ROW fields as normal variables

    ROW fields (members) act as normal variables, and are able to appear in all query parts where a stored procedure variable is allowed:

    • Assignment is using the := operator and the command:

    • Passing to functions and operators:

    • Clauses (select list, WHERE, HAVING, LIMIT, etc...,):

    • INSERT values:

    • SELECT .. INTO targets:

    • Dynamic SQL out parameters ( and )

    ROW type variables as FETCH targets

    ROW type variables are allowed as targets:

    where cur is a CURSOR and rec is a ROW type stored procedure variable.

    Note, currently an attempt to use FETCH for a ROW type variable returns this error:

    FETCH from a cursor cur into a ROW variable rec works as follows:

    • The number of fields in cur must match the number of fields in rec. Otherwise, an error is reported.

    • Assignment is done from left to right. The first cursor field is assigned to the first variable field, the second cursor field is assigned to the second variable field, etc.

    • Field names in rec are not important and can differ from field names in cur.

    See (below) for examples of using this withsql_mode=ORACLE and sql_mode=DEFAULT.

    ROW type variables as SELECT...INTO targets

    ROW type variables are allowed as SELECT..INTO targets with some differences depending on which sql_mode is in use.

    • When using sql_mode=ORACLE, table%ROWTYPE and cursor%ROWTYPE variables can be used as SELECT...INTO targets.

    • Using multiple ROW variables in the SELECT..INTO list will report an error.

    See (below) for examples of using this with sql_mode=ORACLE and sql_mode=DEFAULT.

    Features not implemented

    The following features are planned, but not implemented yet:

    • Returning a ROW type expression from a stored function (see ). This will need some grammar change to support field names after parentheses:

    • Returning a ROW type expression from a built-in hybrid type function, such as CASE, IF, etc.

    • ROW of ROW values

    Examples

    Declaring a ROW in a stored procedure

    FETCH Examples

    A complete FETCH example for sql_mode=ORACLE:

    A complete FETCH example for sql_mode=DEFAULT:

    SELECT...INTO Examples

    A SELECT...INTO example for sql_mode=DEFAULT:

    The above example returns:

    A SELECT...INTO example for sql_mode=ORACLE:

    The above example returns:

    An example for sql_mode=ORACLE using table%ROWTYPE variables as SELECT..INTO targets:

    The above example returns:

    An example for sql_mode=ORACLE using cursor%ROWTYPE variables as SELECT..INTO targets:

    The above example returns:

    Row Table example:

    See Also

    This page is licensed: CC BY-SA / Gnu FDL

    [mariadb]
    ...
    default_time_zone = 'America/New_York'
    SET GLOBAL time_zone = 'America/New_York';
    SHOW GLOBAL VARIABLES LIKE 'time_zone';
    +---------------+--------+
    | Variable_name | Value  |
    +---------------+--------+
    | time_zone     | SYSTEM |
    +---------------+--------+
    SET time_zone = 'America/New_York';
    SHOW SESSION VARIABLES LIKE 'time_zone';
    +---------------+--------+
    | Variable_name | Value  |
    +---------------+--------+
    | time_zone     | SYSTEM |
    +---------------+--------+
    [mariadbd-safe]
    timezone='America/New_York'
    $ export TZ='America/New_York'
    $ service mariadb start
    $ sudo rm /etc/localtime
    $ sudo ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
    sudo dpkg-reconfigure tzdata
    sudo timedatectl set-timezone America/New_York
    [NATIONAL] VARCHAR(M) [CHARACTER SET charset_name] [COLLATE collation_name]
    VARCHAR(30) CHARACTER SET utf8
    NATIONAL VARCHAR(30)
    NVARCHAR(30)
    NCHAR VARCHAR(30)
    NATIONAL CHARACTER VARYING(30)
    NATIONAL CHAR VARYING(30)
    CREATE TABLE strtest (v VARCHAR(10));
    INSERT INTO strtest VALUES('Maria   ');
    
    SELECT v='Maria',v='Maria   ' FROM strtest;
    +-----------+--------------+
    | v='Maria' | v='Maria   ' |
    +-----------+--------------+
    |         1 |            1 |
    +-----------+--------------+
    
    SELECT v LIKE 'Maria',v LIKE 'Maria   ' FROM strtest;
    +----------------+-------------------+
    | v LIKE 'Maria' | v LIKE 'Maria   ' |
    +----------------+-------------------+
    |              0 |                 1 |
    +----------------+-------------------+
    CREATE TABLE varchar_example (
       description VARCHAR(20),
       example VARCHAR(65511)
    ) DEFAULT CHARSET=latin1; -- One byte per char makes the examples clearer
    INSERT INTO varchar_example VALUES
       ('Normal foo', 'foo'),
       ('Trailing spaces foo', 'foo      '),
       ('NULLed', NULL),
       ('Empty', ''),
       ('Maximum', RPAD('', 65511, 'x'));
    SELECT description, LENGTH(example) AS length
       FROM varchar_example;
    +---------------------+--------+
    | description         | length |
    +---------------------+--------+
    | Normal foo          |      3 |
    | Trailing spaces foo |      9 |
    | NULLed              |   NULL |
    | Empty               |      0 |
    | Maximum             |  65511 |
    +---------------------+--------+
    TRUNCATE varchar_example;
    
    INSERT INTO varchar_example VALUES
       ('Overflow', RPAD('', 65512, 'x'));
    ERROR 1406 (22001): Data too long for column 'example' at row 1
    ROW (<field name> <data type> [{, <field name> <data type>}... ])
    UNIX_TIMESTAMP()
    time_zone_transition_type
    Using ROW variables with a different column count than in the SELECT..INTO list will report an error.
    SET
    EXECUTE
    EXECUTE IMMEDIATE
    FETCH
    FETCH Examples
    SELECT...INTO Examples
    MDEV-12252
    STORED PROCEDURES
    DECLARE Variable
    a.x:= 10;
    a.x:= b.x;
    SET a.x= 10, a.y=20, a.z= b.z;
    SELECT f1(rec.a), rec.a<10;
    SELECT var.a, t1.b FROM t1 WHERE t1.b=var.b LIMIT var.c;
    INSERT INTO t1 VALUES (rec.a, rec.b, rec.c);
    SELECT a,b INTO rec.a, rec.b FROM t1 WHERE t1.id=10;
    EXECUTE IMMEDIATE 'CALL proc_with_out_param(?)' USING rec.a;
    FETCH cur INTO rec;
    ERROR 1328 (HY000): Incorrect number of FETCH variables
    SELECT f1().x FROM DUAL;
    DELIMITER $$
    CREATE PROCEDURE p1()
    BEGIN
      DECLARE r ROW (c1 INT, c2 VARCHAR(10));
      SET r.c1= 10;
      SET r.c2= 'test';
      INSERT INTO t1 VALUES (r.c1, r.c2);
    END;
    $$
    DELIMITER ;
    CALL p1();
    DROP TABLE IF EXISTS t1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    INSERT INTO t1 VALUES (20,'b20');
    INSERT INTO t1 VALUES (30,'b30');
    
    SET sql_mode=oracle;
    DROP PROCEDURE IF EXISTS p1;
    DELIMITER $$
    CREATE PROCEDURE p1 AS
      rec ROW(a INT, b VARCHAR(32));
      CURSOR c IS SELECT a,b FROM t1;
    BEGIN
      OPEN c;
      LOOP
        FETCH c INTO rec;
        EXIT WHEN c%NOTFOUND;
        SELECT ('rec=(' || rec.a ||','|| rec.b||')');
      END LOOP;
      CLOSE c;
    END;
    $$
    DELIMITER ;
    CALL p1();
    DROP TABLE IF EXISTS t1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    INSERT INTO t1 VALUES (20,'b20');
    INSERT INTO t1 VALUES (30,'b30');
    
    SET sql_mode=DEFAULT;
    DROP PROCEDURE IF EXISTS p1;
    DELIMITER $$
    CREATE PROCEDURE p1()
    BEGIN
      DECLARE done INT DEFAULT FALSE;
      DECLARE rec ROW(a INT, b VARCHAR(32));
      DECLARE c CURSOR FOR SELECT a,b FROM t1;
      DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
      OPEN c;
    read_loop:
      LOOP
        FETCH c INTO rec;
        IF done THEN
          LEAVE read_loop;
        END IF;
        SELECT CONCAT('rec=(',rec.a,',',rec.b,')');
      END LOOP;
      CLOSE c;
    END;
    $$
    DELIMITER ;
    CALL p1();
    SET sql_mode=DEFAULT;
    DROP TABLE IF EXISTS t1;
    DROP PROCEDURE IF EXISTS p1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    DELIMITER $$
    CREATE PROCEDURE p1()
    BEGIN
      DECLARE rec1 ROW(a INT, b VARCHAR(32));
      SELECT * FROM t1 INTO rec1;
      SELECT rec1.a, rec1.b;
    END;
    $$
    DELIMITER ;
    CALL p1();
    +--------+--------+
    | rec1.a | rec1.b |
    +--------+--------+
    |     10 | b10    |
    +--------+--------+
    SET sql_mode=ORACLE;
    DROP TABLE IF EXISTS t1;
    DROP PROCEDURE IF EXISTS p1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    DELIMITER $$
    CREATE PROCEDURE p1 AS
      rec1 ROW(a INT, b VARCHAR(32));
    BEGIN
      SELECT * FROM t1 INTO rec1;
      SELECT rec1.a, rec1.b;
    END;
    $$
    DELIMITER ;
    CALL p1();
    +--------+--------+
    | rec1.a | rec1.b |
    +--------+--------+
    |     10 | b10    |
    +--------+--------+
    SET sql_mode=ORACLE;
    DROP TABLE IF EXISTS t1;
    DROP PROCEDURE IF EXISTS p1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    DELIMITER $$
    CREATE PROCEDURE p1 AS
      rec1 t1%ROWTYPE;
    BEGIN
      SELECT * FROM t1 INTO rec1;
      SELECT rec1.a, rec1.b;
    END;
    $$
    DELIMITER ;
    CALL p1();
    +--------+--------+
    | rec1.a | rec1.b |
    +--------+--------+
    |     10 | b10    |
    +--------+--------+
    SET sql_mode=ORACLE;
    DROP TABLE IF EXISTS t1;
    DROP PROCEDURE IF EXISTS p1;
    CREATE TABLE t1 (a INT, b VARCHAR(32));
    INSERT INTO t1 VALUES (10,'b10');
    DELIMITER $$
    CREATE PROCEDURE p1 AS
      CURSOR cur1 IS SELECT * FROM t1;
      rec1 cur1%ROWTYPE;
    BEGIN
      SELECT * FROM t1 INTO rec1;
      SELECT rec1.a, rec1.b;
    END;
    $$
    DELIMITER ;
    CALL p1();
    +--------+--------+
    | rec1.a | rec1.b |
    +--------+--------+
    |     10 | b10    |
    +--------+--------+
    CREATE TABLE row_table(
      descr VARCHAR(20),
      val INT
    );
    INSERT INTO row_table VALUES ('Life', 42);
    DELIMITER $$
    CREATE PROCEDURE row_proc()
    BEGIN
      DECLARE rec1 ROW(descr VARCHAR(20), val INT);
      SELECT * INTO rec1 FROM row_table;
      SELECT rec1.descr, rec1.val;
    END;
    $$
    DELIMITER ;
    CALL row_proc();
    
    +------------+----------+
    | rec1.descr | rec1.val |
    +------------+----------+
    | Life       |       42 |
    +------------+----------+
    Data Type Storage Requirements

    INET6

    IPv6 address data type. Stores IPv6 addresses as 16-byte binary strings, also supporting IPv4 addresses via mapping.

    INET6 is available from MariaDB 10.5.

    Syntax

    Description

    The INET6 data type is intended for storage of IPv6 addresses, as well as IPv4 addresses assuming conventional mapping of IPv4 addresses into IPv6 addresses.

    Both short and long IPv6 notation are permitted, according to RFC-5952.

    • Values are stored as a 16-byte fixed length binary string, with most significant byte first.

    • Storage engines see INET6 as BINARY(16).

    • Clients see INET6 as CHAR(39) and get text representation on retrieval.

    The IPv4-compatible notation is considered as deprecated. It is supported for compatibility with the function, which also understands this format. It's recommended to use the mapped format to store IPv4 addresses in INET6.

    When an IPv4 mapped (or compatible) value is stored in INET6, it still occupies 16 bytes:

    Retrieval

    On retrieval, in the client-server text protocol, INET6 values are converted to the short text representation, according to RFC-5952, that is with all leading zeroes in each group removed and with consequent zero groups compressed.

    Besides creating one's own , there is no a way to retrieve an INET6 value using long text representation.

    Casting

    • from a character string to INET6 understands addresses in short or long text notation (including IPv4 mapped and compatible addresses). NULL is returned if the format is not understood.

    • CAST from a binary string to INET6 requires a 16-byte string as an argument. NULL is returned if the argument length is not equal to 16.

    Comparisons

    An INET6 expression can be compared to:

    • another INET6 expression

    • a character string expression with a text (short or long) address representation:

    • a 16-byte binary string expression.

    Attempting to compare INET6 to an expression of any other data type returns an error.

    Mixing INET6 Values for Result

    An INET6 expression can be mixed for result (i.e. , , etc) with:

    • another INET6 expression. The resulting data type is INET6.

    • a character string in text (short or long) address representation. The result data type is INET6. The character string counterpart is automatically converted to INET6. If the string format is not understood, it's converted with a warning to either NULL or to '::', depending on the NULL-ability of the result.

    Attempts to mix INET6 for result with other data types will return an error.

    Mixing INET6 with other data types for and , when mixing for comparison and mixing for result are involved at the same time, uses the same rules with mixing for result, described in the previous paragraphs.

    Functions and Operators

    • with an INET6 argument returns a hexadecimal representation of the underlying 16-byte binary string

    • Arithmetic operators (+,-,*,/,MOD,DIV) are not supported for INET6. This may change in the future.

    • The function now understands INET6 values as an argument

    • The prototypes of the and I functions have changed from a BINARY(16)

    When the argument for the aforementioned two functions is not INET6, automatic implicit CAST to INET6 is applied. As a consequence, both functions understand arguments in both text representation and binary(16) representation.

    When the argument for the aforementioned two functions is not INET6, automatic implicit CAST to INET6 is not applied.

    Prepared Statement Parameters

    INET6 understands both and address representation in parameters (.. and statements).

    Migration between BINARY(16) and INET6

    You may have used as a storage for IPv6 internet addresses, in combination with and to respectively insert and retrieve data.

    However, you can BINARY(16) columns storing IPv6 addresses to INET6. After such an alter, there is no a need to use INET6_ATON() and INET6_NTOA(). Addresses can be inserted and retrieved directly.

    You may use as a storage for IPv6 internet addresses, in combination with and to respectively insert and retrieve data.

    It is also possible to convert INET6 columns to BINARY(16) and continue using the data in combination with INET6_NTOA() and INET6_ATON().

    Examples

    Inserting using short text address notation:

    Long text address notation:

    16-byte binary string notation:

    IPv4 addresses, using IPv4-mapped and IPv4-compatible notations:

    IPv4 mapped (or compatible) values still occupy 16 bytes:

    Casting from INET6 to anything other than returns an error:

    Comparison Examples

    Comparison with another INET6 expression:

    With a character string expression with a text (short or long) address representation:

    With a 16-byte binary string expression:

    With an expression of another data type:

    Mixing for Result Examples

    Mixed with another INET6 expression, returning an INET6 data type:

    Mixed with a character string in text (short or long) address representation:

    Mixed with a 16-byte binary string:

    Mixing with other data types:

    Functions and Operators Examples

    with an INET6 argument returning a hexadecimal representation:

    now understands INET6 values as an argument:

    and prototype now a BINARY(16)):

    Automatic implicit CAST to INET6:

    Prepared Statement Parameters Examples

    Migration between BINARY(16) and INET6 Examples

    Migrating to INET6:

    There's no conversion you can use:

    Migration from INET6 to BINARY(16):

    Casting from INET4 to INET6

    Casting from data types to INET6 is permitted, allowing INET4 values to be inserted into INET6 columns.

    Casting from data types to INET6 is not permitted. You get an error if you try:

    See Also

    • (video)

    This page is licensed: CC BY-SA / Gnu FDL

    INET6
    CAST from other data types to INET6 first converts data to a character string, then CAST from character string to INET6 is applied.
  • CAST from INET6 to CHAR returns short text address notation.

  • CAST from INET6 to BINARY returns its 16-byte binary string representation.

  • CAST from INET6 to data types other than CHAR (e.g. SIGNED, UNSIGNED, TIME, etc) returns an error.

  • a 16-byte binary string. The resulting data type is INET6. The binary string counterpart is automatically converted to INET6. If the length of the binary string is not equal to 16, it's converted with a warning to NULL or to '::' depending on the NULL-ability of the result.

    to
    a INET6
    ,
    INET6_ATON
    stored function
    CAST
    UNION
    CASE..THEN
    COALESCE
    LEAST
    GREATEST
    HEX()
    INET6_ATON
    IS_IPV4_COMPAT
    S_IPV4_MAPPED
    text
    binary(16)
    prepared statement
    PREPARE
    EXECUTE
    EXECUTE IMMEDIATE
    BINARY(16)
    INET6_ATON
    INET6_NTOA
    ALTER
    BINARY(16)
    INET6_ATON
    INET6_NTOA
    CHAR
    HEX
    INET6_ATON
    IS_IPV4_COMPAT
    IS_IPV4_MAPPED
    INET4
    INET4
    IS_IPV6
    INET6_ATON
    INET6_NTOA
    Working with IPv6 in MariaDB - the INET6 datatype
    CREATE TABLE t1 (a INET6);
    INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
    INSERT INTO t1 VALUES ('2001:0db8:0000:0000:0000:ff00:0042:8329');
    INSERT INTO t1 VALUES (0x20010DB8000000000000FF0000428329);
    INSERT INTO t1 VALUES (UNHEX('20010DB8000000000000FF0000428329'));
    INSERT INTO t1 VALUES ('::ffff:192.0.2.128'); -- mapped
    INSERT INTO t1 VALUES ('::192.0.2.128'); -- compatible
    SELECT * FROM t1;
    +------------------------+
    | a                      |
    +------------------------+
    | 2001:db8::ff00:42:8329 |
    | 2001:db8::ff00:42:8329 |
    | 2001:db8::ff00:42:8329 |
    | 2001:db8::ff00:42:8329 |
    | ::ffff:192.0.2.128     |
    | ::192.0.2.128          |
    +------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
    INSERT INTO t1 VALUES ('::ffff:192.0.2.128');
    
    SELECT * FROM t1;
    +--------------------+
    | a                  |
    +--------------------+
    | ::ffff:192.0.2.128 |
    +--------------------+
    
    SELECT HEX(a) FROM t1;
    +----------------------------------+
    | HEX(a)                           |
    +----------------------------------+
    | 00000000000000000000FFFFC0000280 |
    +----------------------------------+
    SELECT CAST(a AS DECIMAL) FROM t1;
    
    ERROR 4079 (HY000): Illegal parameter data type inet6 for operation 'decimal_typecast'
    CREATE OR REPLACE TABLE t1 (a INET6);
        CREATE OR REPLACE TABLE t2 (a INET6);
    
        INSERT INTO t1 VALUES ('2001:db8::ff00:42:8328'),('2001:db8::ff00:42:8329');
        INSERT INTO t2 VALUES ('2001:db8::ff00:42:832a'),('2001:db8::ff00:42:8329');
    
        SELECT t1.* FROM t1,t2 WHERE t1.a=t2.a;
        +------------------------+
        | a                      |
        +------------------------+
        | 2001:db8::ff00:42:8329 |
        +------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
        INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
    
        SELECT * FROM t1 WHERE a='2001:db8::ff00:42:8329';
        +------------------------+
        | a                      |
        +------------------------+
        | 2001:db8::ff00:42:8329 |
        +------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
        INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
    
        SELECT * FROM t1 WHERE a=X'20010DB8000000000000FF0000428329';
        +------------------------+
        | a                      |
        +------------------------+
        | 2001:db8::ff00:42:8329 |
        +------------------------+
    SELECT * FROM t1 WHERE a=1;
    ERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation '='
    CREATE OR REPLACE TABLE t1 (a INET6, b INET6);
    
        INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:8329');
    
        SELECT a FROM t1 UNION SELECT b FROM t1;
        +------------------------+
        | a                      |
        +------------------------+
        | NULL                   |
        | 2001:db8::ff00:42:8329 |
        +------------------------+
    
        SELECT COALESCE(a, b) FROM t1;
        +------------------------+
        | COALESCE(a, b)         |
        +------------------------+
        | 2001:db8::ff00:42:8329 |
        +------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6, b VARCHAR(64));
    
        INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:8328');
    
        INSERT INTO t1 VALUES (NULL,'2001:db8::ff00:42:832a garbage');
    
        SELECT COALESCE(a,b) FROM t1;
        +------------------------+
        | COALESCE(a,b)          |
        +------------------------+
        | 2001:db8::ff00:42:8328 |
        | NULL                   |
        +------------------------+
        2 rows in set, 1 warning (0.001 sec)
    
        SHOW WARNINGS;
        +---------+------+---------------------------------------------------------+
        | Level   | Code | Message                                                 |
        +---------+------+---------------------------------------------------------+
        | Warning | 1292 | Incorrect inet6 value: '2001:db8::ff00:42:832a garbage' |
        +---------+------+---------------------------------------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6, b VARBINARY(16));
    
        INSERT INTO t1 VALUES (NULL,CONCAT(0xFFFF,REPEAT(0x0000,6),0xFFFF));
    
        INSERT INTO t1 VALUES (NULL,0x00/*garbage*/);
    
        SELECT COALESCE(a,b) FROM t1;
        +---------------+
        | COALESCE(a,b) |
        +---------------+
        | ffff::ffff    |
        | NULL          |
        +---------------+
        2 rows in set, 1 warning (0.001 sec)
    
        SHOW WARNINGS;
        +---------+------+-------------------------------+
        | Level   | Code | Message                       |
        +---------+------+-------------------------------+
        | Warning | 1292 | Incorrect inet6 value: '\x00' |
        +---------+------+-------------------------------+
    SELECT CAST('ffff::ffff' AS INET6) UNION SELECT 1;
    ERROR 4078 (HY000): Illegal parameter data types inet6 and int for operation 'UNION'
    SELECT HEX(CAST('2001:db8::ff00:42:8329' AS INET6));
        +----------------------------------------------+
        | HEX(CAST('2001:db8::ff00:42:8329' AS INET6)) |
        +----------------------------------------------+
        | 20010DB8000000000000FF0000428329             |
        +----------------------------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
        INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
    
        SELECT a, HEX(INET6_ATON(a)) FROM t1;
        +------------------------+----------------------------------+
        | a                      | HEX(INET6_ATON(a))               |
        +------------------------+----------------------------------+
        | 2001:db8::ff00:42:8329 | 20010DB8000000000000FF0000428329 |
        +------------------------+----------------------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
        INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
        INSERT INTO t1 VALUES ('::ffff:192.168.0.1');
        INSERT INTO t1 VALUES ('::192.168.0.1');
    
        SELECT a, IS_IPV4_MAPPED(a), IS_IPV4_COMPAT(a) FROM t1;
        +------------------------+-------------------+-------------------+
        | a                      | IS_IPV4_MAPPED(a) | IS_IPV4_COMPAT(a) |
        +------------------------+-------------------+-------------------+
        | 2001:db8::ff00:42:8329 |                 0 |                 0 |
        | ::ffff:192.168.0.1     |                 1 |                 0 |
        | ::192.168.0.1          |                 0 |                 1 |
        +------------------------+-------------------+-------------------+
    CREATE OR REPLACE TABLE t1 (
          a INET6,
          b VARCHAR(39) DEFAULT a
        );
    
        INSERT INTO t1 (a) VALUES ('ffff::ffff'),('::ffff:192.168.0.1');
    
        SELECT a, IS_IPV4_MAPPED(a), b, IS_IPV4_MAPPED(b) FROM t1;
        +--------------------+-------------------+--------------------+-------------------+
        | a                  | IS_IPV4_MAPPED(a) | b                  | IS_IPV4_MAPPED(b) |
        +--------------------+-------------------+--------------------+-------------------+
        | ffff::ffff         |                 0 | ffff::ffff         |                 0 |
        | ::ffff:192.168.0.1 |                 1 | ::ffff:192.168.0.1 |                 1 |
        +--------------------+-------------------+--------------------+-------------------+
    
        CREATE OR REPLACE TABLE t1 (
          a INET6,
          b BINARY(16) DEFAULT UNHEX(HEX(a))
        );
    
        INSERT INTO t1 (a) VALUES ('ffff::ffff'),('::ffff:192.168.0.1');
    
        SELECT a, IS_IPV4_MAPPED(a), HEX(b), IS_IPV4_MAPPED(b) FROM t1;
        +--------------------+-------------------+----------------------------------+-------------------+
        | a                  | IS_IPV4_MAPPED(a) | HEX(b)                           | IS_IPV4_MAPPED(b) |
        +--------------------+-------------------+----------------------------------+-------------------+
        | ffff::ffff         |                 0 | FFFF000000000000000000000000FFFF |                 0 |
        | ::ffff:192.168.0.1 |                 1 | 00000000000000000000FFFFC0A80001 |                 1 |
        +--------------------+-------------------+----------------------------------+-------------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
    EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)' USING 'ffff::fffe';
    EXECUTE IMMEDIATE 'INSERT INTO t1 VALUES (?)' USING X'FFFF000000000000000000000000FFFF';
    
    SELECT * FROM t1;
    +------------+
    | a          |
    +------------+
    | ffff::fffe |
    | ffff::ffff |
    +------------+
    
    EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING 'ffff::fffe';
    +------------+
    | a          |
    +------------+
    | ffff::fffe |
    +------------+
    
    EXECUTE IMMEDIATE 'SELECT * FROM t1 WHERE a=?' USING X'FFFF000000000000000000000000FFFF';
    +------------+
    | a          |
    +------------+
    | ffff::ffff |
    +------------+
    CREATE OR REPLACE TABLE t1 (a BINARY(16));
    
    INSERT INTO t1 VALUES (INET6_ATON('ffff::ffff'));
    
    SELECT INET6_NTOA(a) FROM t1;
    +---------------+
    | INET6_NTOA(a) |
    +---------------+
    | ffff::ffff    |
    +---------------+
    ALTER TABLE t1 MODIFY a INET6;
    
    INSERT INTO t1 VALUES ('ffff::fffe');
    
    SELECT * FROM t1;
    +------------+
    | a          |
    +------------+
    | ffff::ffff |
    | ffff::fffe |
    +------------+
    CREATE OR REPLACE TABLE t1 (a BINARY(16));
    
    INSERT INTO t1 VALUES (INET6_ATON('ffff::ffff'));
    
    SELECT INET6_NTOA(a) FROM t1;
    +---------------+
    | INET6_NTOA(a) |
    +---------------+
    | ffff::ffff    |
    +---------------+
    CREATE OR REPLACE TABLE t1 (a INET6);
    
    INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
    INSERT INTO t1 VALUES ('::ffff:192.168.0.1');
    INSERT INTO t1 VALUES ('::192.168.0.1');
    
    ALTER TABLE t1 MODIFY a BINARY(16);
    
    SELECT INET6_NTOA(a) FROM t1;
    +------------------------+
    | INET6_NTOA(a)          |
    +------------------------+
    | 2001:db8::ff00:42:8329 |
    | ::ffff:192.168.0.1     |
    | ::192.168.0.1          |
    +------------------------+
    CREATE TABLE t1 (a INET6);
    
    INSERT INTO t1 VALUES('0.0.0.0'), ('255.10.0.0'), ('255.255.255.255');
    Query OK, 3 rows affected (0.027 sec)
    CREATE TABLE t1 (a INET6);
    
    INSERT INTO t1 VALUES('0.0.0.0'), ('255.10.0.0'), ('255.255.255.255');
    ERROR 1292 (22007): Incorrect inet6 value: '0.0.0.0' for column `test`.`t1`.`a` at row 1

    Setting Character Sets and Collations

    Learn how to configure character sets and collations at the server, table, and column levels to ensure correct data handling.

    The default character set is utf8mb4 and the default collation is utf8mb4_uca1400_ai_ci. This may differ in some distros, see for example Differences in MariaDB in Debian.

    The default character set is latin1 and the default collation is latin1_swedish_ci. This may differ in some distros, see for example Differences in MariaDB in Debian.

    The character sets and the collations can be specified from the server right down to the column level, as well as for client-server connections. When changing a character set and not specifying a collation, the default collation for the new character set is always used.

    Character sets and collations always cascade down, so a column without a specified collation will look for the table default, the table for the database, and the database for the server. It's therefore possible to have extremely fine-grained control over all the character sets and collations used in your data.

    Default collations for each character set can be viewed with the statement, for example, to find the default collation for the latin2 character set:

    Server Level

    The system variable can be used to change the default server character set. It can be set both on startup or dynamically, with the command:

    Similarly, the variable is used for setting the default server collation.

    Database Level

    The and statements have optional character set and collation clauses. If these are left out, the server defaults are used.

    To determine the default character set used by a database, use:

    Alternatively, for the character set and collation:

    It is also possible to specify only the collation, and, since each collation only applies to one character set, the associated character set will automatically be specified.

    Although there are and system variables which can be set dynamically, these are used for determining the character set and collation for the default database, and should only be set by the server.

    Table Level

    The and statements support optional character set and collation clauses, a MariaDB and MySQL extension to standard SQL.

    If neither character set nor collation is provided, the database default will be used. If only the character set is provided, the default collation for that character set will be used . If only the collation is provided, the associated character set will be used. See .

    If no collation is provided, the collation will be set to the default collation for that character set. See .

    For or columns, CONVERT TO CHARACTER SET changes the data type if needed to ensure the new column is long enough to store as many characters as the original column.

    For example, an ascii TEXT column requires a single byte per character, so the column can hold up to 65,535 characters. If the column is converted to utf8mb4, 4 bytes can be required for each character, so the column will be converted to to be able to hold the same number of characters.

    CONVERT TO CHARACTER SET binary will convert , and columns to , and respectively, and from that point will no longer have a character set, or be affected by future CONVERT TO CHARACTER SET statements.

    To avoid data type changes resulting from CONVERT TO CHARACTER SET, use MODIFY on the individual columns instead. For example:

    Column Level

    Character sets and collations can also be specified for columns that are character types CHAR, TEXT or VARCHAR. The and statements support optional character set and collation clauses for this purpose - unlike those at the table level, the column level definitions are standard SQL.

    If neither collation nor character set is provided, the table default is used. If only the character set is specified, that character set's default collation is used, while if only the collation is specified, the associated character set is used.

    When using to change a column's character set, you need to ensure the character sets are compatible with your data. MariaDB will map the data as best it can, but it's possible to lose data if care is not taken.

    The statement or INFORMATION SCHEMA database can be used to determine column character sets and collations.

    Filenames

    The system variable has controlled interpretation of file names that are given as literal strings. This affects the following statements and functions:

    Literals

    By default, the character set and collation used for literals is determined by the and system variables. However, they can also be specified explicitly:

    The character set of string literals that do not have a character set introducer is determined by the system variable.

    This query always returns the same character set name in both columns.:

    and are normally (e.g. during handshake, or after a SET NAMES query) are set to equal values. However, it's possible to set to different values.

    Examples

    Examples when setting @@character_set_client and @@character_set_connection to different values can be useful:

    Example 1:

    Suppose, we have a utf8 database with this table:

    Now we connect to it using a client which uses the DOS character set (cp850 on a West European machine), and want to fetch all records that are equal to 'ö' according to the German phonebook rules.

    It's possible with the following:

    This will return:

    It works as follows:

    1. The client sends the query using cp850.

    2. The server, when parsing the query, creates a utf8 string literal by converting 'ö' from @@character_set_client (cp850) to @@character_set_connection (utf8).

    3. The server applies the collation utf8_german2_ci to this string literal.

    Note, if we rewrite the script like this:

    We get an error:

    Reason:

    • In step #2, the literal is not converted to utf8 any more and is created using cp850.

    • In step #3, the server fails to apply utf8_german2_ci to an cp850 string literal.

    Example 2:

    Suppose we have a utf8 database and use "mysql.exe" from a West European machine again.

    We can do this:

    It creates a table with a column of the type VARCHAR(1) CHARACTER SET utf8.

    Note, if we rewrite the query like this:

    It creates a table with a column of the type VARCHAR(1) CHARACTER SET cp850, which is probably not a good idea.

    N

    Also, N or n can be used as prefix to convert a literal into the National Character set (which in MariaDB is always utf8).

    For example:

    Stored Programs and Views

    The literals which occur in stored programs and views, by default, use the character set and collation which was specified by the and system variables when the stored program was created. These values can be seen using the SHOW CREATE statements. To change the character sets used for literals in an existing stored program, it is necessary to drop and recreate the stored program.

    For stored routines parameters and return values, a character set and a collation can be specified via the CHARACTER SET and COLLATE clauses.

    The following example shows that the character set and collation are determined at the time of creation:

    The following example shows how to specify a function parameters character set and collation:

    Changing Default Collation

    It is possible to change the default collation associated with a particular character set. The system variable accepts a comma-delimited list of character sets and new default collations, for example:

    It is not possible to change the default collation associated with a particular character set.

    The new variable will take effect in all cases where a character set is explicitly or implicitly specified without an explicit COLLATE clause, including but not limited to:

    • Column collation

    • Table collation

    • Database collation

    • CHAR(expr USING csname)

    Example: Changing the Default Character Set To UTF-8

    To change the default character set from latin1 to UTF-8, the following settings should be specified in the my.cnf configuration file.

    Note that the default-character-set option is a client option, not a server option.

    See Also

    This page is licensed: CC BY-SA / Gnu FDL

    LOAD_FILE()

    The server uses utf8_german2_ci for comparison.

    CONVERT(expr USING csname)

  • CAST(expr AS CHAR CHARACTER SET csname)

  • '' - character string literal

  • _utf8mb3'text' - a character string literal with an introducer

  • _utf8mb3 X'61' - a character string literal with an introducer with hex notation

  • _utf8mb3 0x61 - a character string literal with an introducer with hex hybrid notation

  • @@collation_connection after a SET NAMES statement without COLLATE

  • SHOW COLLATION
    character_set_server
    SET
    collation_server
    CREATE DATABASE
    ALTER DATABASE
    character_set_database
    collation_database
    CREATE TABLE
    ALTER TABLE
    Supported Character Sets and Collations
    Supported Character Sets and Collations
    VARCHAR
    TEXT
    MEDIUMTEXT
    CHAR
    VARCHAR
    TEXT
    BINARY
    VARBINARY
    BLOB
    CREATE TABLE
    ALTER TABLE
    ALTER TABLE
    SHOW CREATE TABLE
    character_set_filesystem
    SELECT INTO DUMPFILE
    SELECT INTO OUTFILE
    LOAD DATA INFILE
    LOAD XML
    character_set_connection
    collation_connection
    character_set_connection
    character_set_client
    character_set_connection
    character_set_connection
    collation_connection
    character_set_collations
    String literals
    CAST()
    CONVERT()
    Operator Precedence
    SHOW COLLATION LIKE 'latin2%';
    +---------------------+---------+----+---------+----------+---------+
    | Collation           | Charset | Id | Default | Compiled | Sortlen |
    +---------------------+---------+----+---------+----------+---------+
    | latin2_czech_cs     | latin2  |  2 |         | Yes      |       4 |
    | latin2_general_ci   | latin2  |  9 | Yes     | Yes      |       1 |
    | latin2_hungarian_ci | latin2  | 21 |         | Yes      |       1 |
    | latin2_croatian_ci  | latin2  | 27 |         | Yes      |       1 |
    | latin2_bin          | latin2  | 77 |         | Yes      |       1 |
    +---------------------+---------+----+---------+----------+---------+
    SET character_set_server = 'latin2';
    SET collation_server = 'latin2_czech_cs';
    CREATE DATABASE czech_slovak_names 
      CHARACTER SET = 'keybcs2'
      COLLATE = 'keybcs2_bin';
    ALTER DATABASE czech_slovak_names COLLATE = 'keybcs2_general_ci';
    SHOW CREATE DATABASE czech_slovak_names;
    +--------------------+--------------------------------------------------------------------------------+
    | Database           | Create Database                                                                |
    +--------------------+--------------------------------------------------------------------------------+
    | czech_slovak_names | CREATE DATABASE `czech_slovak_names` /*!40100 DEFAULT CHARACTER SET keybcs2 */ |
    +--------------------+--------------------------------------------------------------------------------+
    SELECT * FROM INFORMATION_SCHEMA.SCHEMATA;
    +--------------+--------------------+----------------------------+------------------------+----------+
    | CATALOG_NAME | SCHEMA_NAME        | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |
    +--------------+--------------------+----------------------------+------------------------+----------+
    | def          | czech_slovak_names | keybcs2                    | keybcs2_general_ci     | NULL     |
    | def          | information_schema | utf8                       | utf8_general_ci        | NULL     |
    | def          | mysql              | latin1                     | latin1_swedish_ci      | NULL     |
    | def          | performance_schema | utf8                       | utf8_general_ci        | NULL     |
    | def          | test               | latin1                     | latin1_swedish_ci      | NULL     |
    +--------------+--------------------+----------------------------+------------------------+----------+
    CREATE DATABASE danish_names COLLATE 'utf8_danish_ci';
    
    SHOW CREATE DATABASE danish_names;
    +--------------+----------------------------------------------------------------------------------------------+
    | Database     | Create Database                                                                              |
    +--------------+----------------------------------------------------------------------------------------------+
    | danish_names | CREATE DATABASE `danish_names` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_danish_ci */ |
    +--------------+----------------------------------------------------------------------------------------------+
    CREATE TABLE english_names (id INT, name VARCHAR(40)) 
      CHARACTER SET 'utf8' 
      COLLATE 'utf8_icelandic_ci';
    ALTER TABLE table_name
     CONVERT TO CHARACTER SET charset_name [COLLATE collation_name];
    ALTER TABLE table_name MODIFY ascii_text_column TEXT CHARACTER SET utf8;
    ALTER TABLE table_name MODIFY ascii_varchar_column VARCHAR(M) CHARACTER SET utf8;
    CREATE TABLE european_names (
      croatian_names VARCHAR(40) COLLATE 'cp1250_croatian_ci',
      greek_names VARCHAR(40) CHARACTER SET 'greek');
    SHOW CREATE TABLE european_names\G
    *************************** 1. row ***************************
           Table: european_names
    Create Table: CREATE TABLE `european_names` (
      `croatian_names` varchar(40) CHARACTER SET cp1250 COLLATE cp1250_croatian_ci DEFAULT NULL,
      `greek_names` varchar(40) CHARACTER SET greek DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci
    SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME LIKE 'european%'\G
    *************************** 1. row ***************************
               TABLE_CATALOG: def
                TABLE_SCHEMA: danish_names
                  TABLE_NAME: european_names
                 COLUMN_NAME: croatian_names
            ORDINAL_POSITION: 1
              COLUMN_DEFAULT: NULL
                 IS_NULLABLE: YES
                   DATA_TYPE: varchar
    CHARACTER_MAXIMUM_LENGTH: 40
      CHARACTER_OCTET_LENGTH: 40
           NUMERIC_PRECISION: NULL
               NUMERIC_SCALE: NULL
          DATETIME_PRECISION: NULL
          CHARACTER_SET_NAME: cp1250
              COLLATION_NAME: cp1250_croatian_ci
                 COLUMN_TYPE: varchar(40)
                  COLUMN_KEY: 
                       EXTRA: 
                  PRIVILEGES: select,insert,update,references
              COLUMN_COMMENT: 
    *************************** 2. row ***************************
               TABLE_CATALOG: def
                TABLE_SCHEMA: danish_names
                  TABLE_NAME: european_names
                 COLUMN_NAME: greek_names
            ORDINAL_POSITION: 2
              COLUMN_DEFAULT: NULL
                 IS_NULLABLE: YES
                   DATA_TYPE: varchar
    CHARACTER_MAXIMUM_LENGTH: 40
      CHARACTER_OCTET_LENGTH: 40
           NUMERIC_PRECISION: NULL
               NUMERIC_SCALE: NULL
          DATETIME_PRECISION: NULL
          CHARACTER_SET_NAME: greek
              COLLATION_NAME: greek_general_ci
                 COLUMN_TYPE: varchar(40)
                  COLUMN_KEY: 
                       EXTRA: 
                  PRIVILEGES: select,insert,update,references
              COLUMN_COMMENT:
    [_charset_name]'string' [COLLATE collation_name]
    SELECT CHARSET('a'), @@character_set_connection;
    CREATE TABLE t1 (a VARCHAR(10)) CHARACTER SET utf8 COLLATE utf8_general_ci;
    INSERT INTO t1 VALUES ('oe'),('ö');
    SET @@character_set_client=cp850, @@character_set_connection=utf8;
    SELECT a FROM t1 WHERE a='ö' COLLATE utf8_german2_ci;
    +------+
    | a    |
    +------+
    | oe   |
    | ö    |
    +------+
    SET NAMES cp850;
    SELECT a FROM t1 WHERE a='ö' COLLATE utf8_german2_ci;
    ERROR 1253 (42000): COLLATION 'utf8_german2_ci' is not valid for CHARACTER SET 'cp850'
    SET @@character_set_client=cp850, @@character_set_connection=utf8;
    CREATE TABLE t2 AS SELECT 'ö';
    SET NAMES cp850;
    CREATE TABLE t2 AS SELECT 'ö';
    SELECT _latin2 'Müller';
    +-----------+
    | MĂźller   |
    +-----------+
    | MĂźller   |
    +-----------+
    SELECT CHARSET(N'a string');
    +----------------------+
    | CHARSET(N'a string') |
    +----------------------+
    | utf8mb3              |
    +----------------------+
    SELECT 'Mueller' = 'Müller' COLLATE 'latin1_german2_ci';
    +---------------------------------------------------+
    | 'Mueller' = 'Müller' COLLATE 'latin1_german2_ci'  |
    +---------------------------------------------------+
    |                                                 1 |
    +---------------------------------------------------+
    SELECT CHARSET(N'a string');
    +----------------------+
    | CHARSET(N'a string') |
    +----------------------+
    | utf8                 |
    +----------------------+
    SET @@local.character_set_connection='latin1';
    
    DELIMITER ||
    CREATE PROCEDURE `test`.`x`()
    BEGIN
    	SELECT CHARSET('x');
    END;
    ||
    Query OK, 0 rows affected (0.00 sec)
    
    DELIMITER ;
    SET @@local.character_set_connection='utf8';
    
    CALL `test`.`x`();
    +--------------+
    | CHARSET('x') |
    +--------------+
    | latin1       |
    +--------------+
    CREATE FUNCTION `test`.`y`(`str` TEXT CHARACTER SET utf8 COLLATE utf8_bin)
    	RETURNS TEXT CHARACTER SET latin1 COLLATE latin1_bin
    BEGIN
    	SET @param_coll = COLLATION(`str`);
    	RETURN `str`;
    END;
    
    -- return value's collation:
    SELECT COLLATION(`test`.`y`('Hello, planet!'));
    +-----------------------------------------+
    | COLLATION(`test`.`y`('Hello, planet!')) |
    +-----------------------------------------+
    | latin1_bin                              |
    +-----------------------------------------+
    
    -- parameter's collation:
    SELECT @param_coll;
    +-------------+
    | @param_coll |
    +-------------+
    | utf8_bin    |
    +-------------+
    SET @@character_set_collations = 'utf8mb4=uca1400_ai_ci, latin2=latin2_hungarian_ci';
    [mysql]
    ...
    default-character-set=utf8mb4
    ...
    [mysqld]
    ...
    collation-server = utf8mb4_unicode_ci
    init-connect='SET NAMES utf8mb4'
    character-set-server = utf8mb4
    ...

    Server Locale

    Server locale settings control the language for date and time functions via lc_time_names and the language for error messages via lc_messages.

    The lc_time_names server system variable sets the language used by the date and time functions DAYNAME(), MONTHNAME(), and DATE_FORMAT(), and the lc_messages sets the language for error messages.

    The list of the locales supported by the current MariaDB installation can be obtained via the LOCALES plugin.

    MariaDB supports the following locale values:

    Locale
    Language
    Territory

    ar_AE

    Arabic

    United Arab Emirates

    Examples

    Setting the and variables to localize the units of date and time, and the server error messages.

    This page is licensed: CC BY-SA / Gnu FDL

    ar_BH

    Arabic

    Bahrain

    ar_DZ

    Arabic

    Algeria

    ar_EG

    Arabic

    Egypt

    ar_IN

    Arabic

    Iran

    ar_IQ

    Arabic

    Iraq

    ar_JO

    Arabic

    Jordan

    ar_KW

    Arabic

    Kuwait

    ar_LB

    Arabic

    Lebanon

    ar_LY

    Arabic

    Libya

    ar_MA

    Arabic

    Morocco

    ar_OM

    Arabic

    Oman

    ar_QA

    Arabic

    Qatar

    ar_SA

    Arabic

    Saudi Arabia

    ar_SD

    Arabic

    Sudan

    ar_SY

    Arabic

    Syria

    ar_TN

    Arabic

    Tunisia

    ar_YE

    Arabic

    Yemen

    be_BY

    Belarusian

    Belarus

    bg_BG

    Bulgarian

    Bulgaria

    ca_ES

    Catalan

    Catalan

    cs_CZ

    Czech

    Czech Republic

    da_DK

    Danish

    Denmark

    de_AT

    German

    Austria

    de_BE

    German

    Belgium

    de_CH

    German

    Switzerland

    de_DE

    German

    Germany

    de_LU

    German

    Luxembourg

    el_GR

    Greek

    Greece

    en_AU

    English

    Australia

    en_CA

    English

    Canada

    en_GB

    English

    United Kingdom

    en_IN

    English

    India

    en_NZ

    English

    New Zealand

    en_PH

    English

    Philippines

    en_US

    English

    United States

    en_ZA

    English

    South Africa

    en_ZW

    English

    Zimbabwe

    es_AR

    Spanish

    Argentina

    es_BO

    Spanish

    Bolivia

    es_CL

    Spanish

    Chile

    es_CO

    Spanish

    Columbia

    es_CR

    Spanish

    Costa Rica

    es_DO

    Spanish

    Dominican Republic

    es_EC

    Spanish

    Ecuador

    es_ES

    Spanish

    Spain

    es_GT

    Spanish

    Guatemala

    es_HN

    Spanish

    Honduras

    es_MX

    Spanish

    Mexico

    es_NI

    Spanish

    Nicaragua

    es_PA

    Spanish

    Panama

    es_PE

    Spanish

    Peru

    es_PR

    Spanish

    Puerto Rico

    es_PY

    Spanish

    Paraguay

    es_SV

    Spanish

    El Salvador

    es_US

    Spanish

    United States

    es_UY

    Spanish

    Uruguay

    es_VE

    Spanish

    Venezuela

    et_EE

    Estonian

    Estonia

    eu_ES

    Basque

    Basque

    fi_FI

    Finnish

    Finland

    fo_FO

    Faroese

    Faroe Islands

    fr_BE

    French

    Belgium

    fr_CA

    French

    Canada

    fr_CH

    French

    Switzerland

    fr_FR

    French

    France

    fr_LU

    French

    Luxembourg

    gl_ES

    Galician

    Galician

    gu_IN

    Gujarati

    India

    he_IL

    Hebrew

    Israel

    hi_IN

    Hindi

    India

    hr_HR

    Croatian

    Croatia

    hu_HU

    Hungarian

    Hungary

    id_ID

    Indonesian

    Indonesia

    is_IS

    Icelandic

    Iceland

    it_CH

    Italian

    Switzerland

    it_IT

    Italian

    Italy

    ja_JP

    Japanese

    Japan

    ka_GE

    Georgian

    Georgia (From )

    ko_KR

    Korean

    Republic of Korea

    lt_LT

    Lithuanian

    Lithuania

    lv_LV

    Latvian

    Latvia

    mk_MK

    Macedonian

    FYROM

    mn_MN

    Mongolia

    Mongolian

    ms_MY

    Malay

    Malaysia

    nb_NO

    Norwegian(Bokmål)

    Norway

    nl_BE

    Dutch

    Belgium

    nl_NL

    Dutch

    The Netherlands

    no_NO

    Norwegian

    Norway

    pl_PL

    Polish

    Poland

    pt_BR

    Portugese

    Brazil

    pt_PT

    Portugese

    Portugal

    rm_CH

    Romansh

    Switzerland

    ro_RO

    Romanian

    Romania

    ru_RU

    Russian

    Russia

    ru_UA

    Russian

    Ukraine

    sk_SK

    Slovak

    Slovakia

    sl_SI

    Slovenian

    Slovenia

    sq_AL

    Albanian

    Albania

    sr_YU

    Serbian

    Serbia (Deprecated in and removed in )

    sv_FI

    Swedish

    Finland

    sv_SE

    Swedish

    Sweden

    sw_KE

    Swahili

    Kenya (from )

    ta_IN

    Tamil

    India

    te_IN

    Telugu

    India

    th_TH

    Thai

    Thailand

    tr_TR

    Turkish

    Turkey

    uk_UA

    Ukrainian

    Ukraine

    ur_PK

    Urdu

    Pakistan

    vi_VN

    Vietnamese

    Viet Nam

    zh_CN

    Chinese

    China

    zh_HK

    Chinese

    Hong Kong

    zh_TW

    Chinese

    Taiwan Province of China

    lc_time_names
    lc_messages
    SELECT DAYNAME('2013-04-01'), MONTHNAME('2013-04-01');
    +-----------------------+-------------------------+
    | DAYNAME('2013-04-01') | MONTHNAME('2013-04-01') |
    +-----------------------+-------------------------+
    | Monday                | April                   |
    +-----------------------+-------------------------+
    
    SET lc_time_names = 'fr_CA';
    
    SELECT DAYNAME('2013-04-01'), MONTHNAME('2013-04-01');
    +-----------------------+-------------------------+
    | DAYNAME('2013-04-01') | MONTHNAME('2013-04-01') |
    +-----------------------+-------------------------+
    | lundi                 | avril                   |
    +-----------------------+-------------------------+
    
    SELECT blah;
    ERROR 1054 (42S22): Unknown column 'blah' in 'field' list'
    
    SET lc_messages = 'nl_NL';
    
    SELECT blah;
    ERROR 1054 (42S22): Onbekende kolom 'blah' in field list

    Supported Character Sets and Collations

    View a comprehensive list of the character sets and collations available in MariaDB database, including their default properties and maximum lengths.

    Character Sets

    You can see which character sets are available in a particular version by running the SHOW CHARACTER SET statement or by querying the Information Schema CHARACTER_SETS Table.

    It is possible to change the default collation associated with a character set. See Changing Default Collation.

    It is not possible to change the default collation associated with a character set. See Changing Default Collation

    MariaDB supports the following character sets:

    Charset
    Description
    Default collation
    Maxlen

    Note that the only supports a limited number of character sets. See .

    Collations

    MariaDB supports the following collations (from ):

    ℹ️ The UCA-14.0.0 collations were added in .

    ℹ️ Before , the utf8mb3* collations listed above were named utf8*.

    ℹ️ added UCA-9.0.0 collations, as well as a Comment column to information_schema.collations, to make it clear that the UCA-9.0.0 collations are mapped to the UCA-14.0.0 collations. The UCA-9.0.0 collations have mainly been added to make it easy to replicate from MySQL 8.0 to MariaDB 11.4.5 and newer.

    Note that some of the collations are used with several different character sets. In this case, the Charset and Id columns are NULL.

    You can find all combinations of the supported character set and collation in the table.

    Case Sensitivity

    A 'ci' at the end of a collation name indicates the collation is case-insensitive. A 'cs' at the end of a collation name indicates the collation is case sensitive.

    NO PAD Collations

    NO PAD collations regard trailing spaces as normal characters. You can get a list of all of these by querying the as follows:

    Accent Insensitivity

    An accent insensitive collation is one where the accented and unaccented versions of a letter are considered to be identical for sorting purposes.

    ℹ️ added the accent insensitivity flag, and new collations are marked with '_ai' or '_as' in the name to indicate this, for example:

    Changes

    • added 184 UCA-14.0.0 collations. Unicode-14.0.0 was released in September 2021. They contain 939 . Old collations based on UCA-4.0.0 and UCA-5.2.0 did not support built-in contractions. This is a step towards better Unicode Collation Algorithm compliance. With built-in contractions, some languages (e.g., Thai) won't need specific collations and will just work with the default "root" collation.

    • changed the utf8 character set by default to be an alias for utf8mb3 rather than the other way around. It can be set to imply utf8mb4 by changing the value of the system variable.

    • added 88 NO PAD

    See Also

    This page is licensed: CC BY-SA / Gnu FDL

    binary

    Binary pseudo charset

    binary

    1

    cp1250

    Windows Central European

    cp1250_general_ci

    1

    cp1251

    Windows Cyrillic

    cp1251_general_ci

    1

    cp1256

    Windows Arabic

    cp1256_general_ci

    1

    cp1257

    Windows Baltic

    cp1257_general_ci

    1

    cp850

    DOS West European

    cp850_general_ci

    1

    cp852

    DOS Central European

    cp852_general_ci

    1

    cp866

    DOS Russian

    cp866_general_ci

    1

    cp932

    SJIS for Windows Japanese

    cp932_japanese_ci

    2

    dec8

    DEC West European

    dec8_swedish_ci

    1

    eucjpms

    UJIS for Windows Japanese

    eucjpms_japanese_ci

    3

    euckr

    EUC-KR Korean

    euckr_korean_ci

    2

    gb2312

    GB2312 Simplified Chinese

    gb2312_chinese_ci

    2

    gbk

    GBK Simplified Chinese

    gbk_chinese_ci

    2

    geostd8

    GEOSTD8 Georgian

    geostd8_general_ci

    1

    greek

    ISO 8859-7 Greek

    greek_general_ci

    1

    hebrew

    ISO 8859-8 Hebrew

    hebrew_general_ci

    1

    hp8

    HP West European

    hp8_english_ci

    1

    keybcs2

    DOS Kamenicky Czech-Slovak

    keybcs2_general_ci

    1

    koi8r

    KOI8-R Relcom Russian

    koi8r_general_ci

    1

    koi8u

    KOI8-U Ukrainian

    koi8u_general_ci

    1

    latin1

    cp1252 West European

    latin1_swedish_ci

    1

    latin2

    ISO 8859-2 Central European

    latin2_general_ci

    1

    latin5

    ISO 8859-9 Turkish

    latin5_turkish_ci

    1

    latin7

    ISO 8859-13 Baltic

    latin7_general_ci

    1

    macce

    Mac Central European

    macce_general_ci

    1

    macroman

    Mac West European

    macroman_general_ci

    1

    sjis

    Shift-JIS Japanese

    sjis_japanese_ci

    2

    swe7

    7bit Swedish

    swe7_swedish_ci

    1

    tis620

    TIS620 Thai

    tis620_thai_ci

    1

    ucs2

    UCS-2 Unicode

    ucs2_general_ci (<= MariaDB 11.4) ucs2_uca1400_ai_ci (>=)

    2

    ujis

    EUC-JP Japanese

    ujis_japanese_ci

    3

    utf8

    UTF-8 Unicode

    utf8_general_ci

    3/4 (see )

    utf16

    UTF-16 Unicode

    utf16_general_ci (<= ) utf16_uca1400_ai_ci (>=)

    4

    utf16le

    UTF-16LE Unicode

    utf16le_general_ci

    4

    utf32

    UTF-32 Unicode

    utf32_general_ci (<= ) utf32_uca1400_ai_ci (>=)

    4

    utf8mb3

    UTF-8 Unicode

    utf8mb3_general_ci (<= ) utf8mb3_uca1400_ai_ci (>=)

    3

    utf8mb4

    UTF-8 Unicode

    utf8mb4_general_ci (<= ) utf8mb4_uca1400_ai_ci (>=)

    4

    collations.
  • added the utf8_thai_520_w2, utf8mb4_thai_520_w2, ucs2_thai_520_w2, utf16_thai_520_w2 and utf32_thai_520_w2 collations.

  • added the utf8_myanmar_ci, ucs2_myanmar_ci, utf8mb4_myanmar_ci, utf16_myanmar_ci and utf32_myanmar_ci collations.

  • added the utf8_german2_ci, utf8mb4_german2_ci, ucs2_german2_ci, utf16_german2_ci and utf32_german2_ci collations.

  • added a Croatian collation patch from Alexander Barkov to fix some problems with the Croatian character set and LIKE queries. This patch added utf8_croatian_ci and ucs2_croatian_ci collations to MariaDB.

  • armscii8

    ARMSCII-8 Armenian

    armscii8_general_ci

    1

    ascii

    US ASCII

    ascii_general_ci

    1

    big5

    Big5 Traditional Chinese

    big5_chinese_ci

    Mroonga Storage Engine
    Mroonga's available character sets
    information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
    Information Schema COLLATIONS Table
    built-in contractions
    old_mode
    Information Schema CHARACTER_SETS Table
    Information Schema COLLATIONS Table

    2

    SELECT collation_name, character_set_name as cs_name, id, is_default AS def, is_compiled AS com, 
      sortlen, comment FROM information_schema.collations ORDER BY collation_name;
    +--------------------------------+----------+------+------+-----+---------+--------------------------------------------------+
    | collation_name                 | cs_name  | id   | def  | com | sortlen | comment                                          |
    +--------------------------------+----------+------+------+-----+---------+--------------------------------------------------+
    | armscii8_bin                   | armscii8 |   64 |      | Yes |       1 | ARMSCII-8 Armenian                               |
    | armscii8_general_ci            | armscii8 |   32 | Yes  | Yes |       1 | ARMSCII-8 Armenian                               |
    | armscii8_general_nopad_ci      | armscii8 | 1056 |      | Yes |       1 | ARMSCII-8 Armenian                               |
    | armscii8_nopad_bin             | armscii8 | 1088 |      | Yes |       1 | ARMSCII-8 Armenian                               |
    | ascii_bin                      | ascii    |   65 |      | Yes |       1 | US ASCII                                         |
    | ascii_general_ci               | ascii    |   11 | Yes  | Yes |       1 | US ASCII                                         |
    | ascii_general_nopad_ci         | ascii    | 1035 |      | Yes |       1 | US ASCII                                         |
    | ascii_nopad_bin                | ascii    | 1089 |      | Yes |       1 | US ASCII                                         |
    | big5_bin                       | big5     |   84 |      | Yes |       1 | Big5 Traditional Chinese                         |
    | big5_chinese_ci                | big5     |    1 | Yes  | Yes |       1 | Big5 Traditional Chinese                         |
    | big5_chinese_nopad_ci          | big5     | 1025 |      | Yes |       1 |                                                  |
    | big5_nopad_bin                 | big5     | 1108 |      | Yes |       1 |                                                  |
    | binary                         | binary   |   63 | Yes  | Yes |       1 | Binary pseudo charset                            |
    | cp1250_bin                     | cp1250   |   66 |      | Yes |       1 | Windows Central European                         |
    | cp1250_croatian_ci             | cp1250   |   44 |      | Yes |       1 | Windows Central European                         |
    | cp1250_czech_cs                | cp1250   |   34 |      | Yes |       2 | Windows Central European                         |
    | cp1250_general_ci              | cp1250   |   26 | Yes  | Yes |       1 | Windows Central European                         |
    | cp1250_general_nopad_ci        | cp1250   | 1050 |      | Yes |       1 | Windows Central European                         |
    | cp1250_nopad_bin               | cp1250   | 1090 |      | Yes |       1 | Windows Central European                         |
    | cp1250_polish_ci               | cp1250   |   99 |      | Yes |       1 | Windows Central European                         |
    | cp1251_bin                     | cp1251   |   50 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_bulgarian_ci            | cp1251   |   14 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_general_ci              | cp1251   |   51 | Yes  | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_general_cs              | cp1251   |   52 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_general_nopad_ci        | cp1251   | 1075 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_nopad_bin               | cp1251   | 1074 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1251_ukrainian_ci            | cp1251   |   23 |      | Yes |       1 | Windows Cyrillic                                 |
    | cp1256_bin                     | cp1256   |   67 |      | Yes |       1 | Windows Arabic                                   |
    | cp1256_general_ci              | cp1256   |   57 | Yes  | Yes |       1 | Windows Arabic                                   |
    | cp1256_general_nopad_ci        | cp1256   | 1081 |      | Yes |       1 | Windows Arabic                                   |
    | cp1256_nopad_bin               | cp1256   | 1091 |      | Yes |       1 | Windows Arabic                                   |
    | cp1257_bin                     | cp1257   |   58 |      | Yes |       1 | Windows Baltic                                   |
    | cp1257_general_ci              | cp1257   |   59 | Yes  | Yes |       1 | Windows Baltic                                   |
    | cp1257_general_nopad_ci        | cp1257   | 1083 |      | Yes |       1 | Windows Baltic                                   |
    | cp1257_lithuanian_ci           | cp1257   |   29 |      | Yes |       1 | Windows Baltic                                   |
    | cp1257_nopad_bin               | cp1257   | 1082 |      | Yes |       1 | Windows Baltic                                   |
    | cp850_bin                      | cp850    |   80 |      | Yes |       1 | DOS West European                                |
    | cp850_general_ci               | cp850    |    4 | Yes  | Yes |       1 | DOS West European                                |
    | cp850_general_nopad_ci         | cp850    | 1028 |      | Yes |       1 | DOS West European                                |
    | cp850_nopad_bin                | cp850    | 1104 |      | Yes |       1 | DOS West European                                |
    | cp852_bin                      | cp852    |   81 |      | Yes |       1 | DOS Central European                             |
    | cp852_general_ci               | cp852    |   40 | Yes  | Yes |       1 | DOS Central European                             |
    | cp852_general_nopad_ci         | cp852    | 1064 |      | Yes |       1 | DOS Central European                             |
    | cp852_nopad_bin                | cp852    | 1105 |      | Yes |       1 | DOS Central European                             |
    | cp866_bin                      | cp866    |   68 |      | Yes |       1 | DOS Russian                                      |
    | cp866_general_ci               | cp866    |   36 | Yes  | Yes |       1 | DOS Russian                                      |
    | cp866_general_nopad_ci         | cp866    | 1060 |      | Yes |       1 | DOS Russian                                      |
    | cp866_nopad_bin                | cp866    | 1092 |      | Yes |       1 | DOS Russian                                      |
    | cp932_bin                      | cp932    |   96 |      | Yes |       1 | SJIS for Windows Japanese                        |
    | cp932_japanese_ci              | cp932    |   95 | Yes  | Yes |       1 | SJIS for Windows Japanese                        |
    | cp932_japanese_nopad_ci        | cp932    | 1119 |      | Yes |       1 |                                                  |
    | cp932_nopad_bin                | cp932    | 1120 |      | Yes |       1 |                                                  |
    | dec8_bin                       | dec8     |   69 |      | Yes |       1 | DEC West European                                |
    | dec8_nopad_bin                 | dec8     | 1093 |      | Yes |       1 | DEC West European                                |
    | dec8_swedish_ci                | dec8     |    3 | Yes  | Yes |       1 | DEC West European                                |
    | dec8_swedish_nopad_ci          | dec8     | 1027 |      | Yes |       1 | DEC West European                                |
    | eucjpms_bin                    | eucjpms  |   98 |      | Yes |       1 | UJIS for Windows Japanese                        |
    | eucjpms_japanese_ci            | eucjpms  |   97 | Yes  | Yes |       1 | UJIS for Windows Japanese                        |
    | eucjpms_japanese_nopad_ci      | eucjpms  | 1121 |      | Yes |       1 |                                                  |
    | eucjpms_nopad_bin              | eucjpms  | 1122 |      | Yes |       1 |                                                  |
    | euckr_bin                      | euckr    |   85 |      | Yes |       1 | EUC-KR Korean                                    |
    | euckr_korean_ci                | euckr    |   19 | Yes  | Yes |       1 | EUC-KR Korean                                    |
    | euckr_korean_nopad_ci          | euckr    | 1043 |      | Yes |       1 |                                                  |
    | euckr_nopad_bin                | euckr    | 1109 |      | Yes |       1 |                                                  |
    | gb2312_bin                     | gb2312   |   86 |      | Yes |       1 | GB2312 Simplified Chinese                        |
    | gb2312_chinese_ci              | gb2312   |   24 | Yes  | Yes |       1 | GB2312 Simplified Chinese                        |
    | gb2312_chinese_nopad_ci        | gb2312   | 1048 |      | Yes |       1 |                                                  |
    | gb2312_nopad_bin               | gb2312   | 1110 |      | Yes |       1 |                                                  |
    | gbk_bin                        | gbk      |   87 |      | Yes |       1 | GBK Simplified Chinese                           |
    | gbk_chinese_ci                 | gbk      |   28 | Yes  | Yes |       1 | GBK Simplified Chinese                           |
    | gbk_chinese_nopad_ci           | gbk      | 1052 |      | Yes |       1 |                                                  |
    | gbk_nopad_bin                  | gbk      | 1111 |      | Yes |       1 |                                                  |
    | geostd8_bin                    | geostd8  |   93 |      | Yes |       1 | GEOSTD8 Georgian                                 |
    | geostd8_general_ci             | geostd8  |   92 | Yes  | Yes |       1 | GEOSTD8 Georgian                                 |
    | geostd8_general_nopad_ci       | geostd8  | 1116 |      | Yes |       1 | GEOSTD8 Georgian                                 |
    | geostd8_nopad_bin              | geostd8  | 1117 |      | Yes |       1 | GEOSTD8 Georgian                                 |
    | greek_bin                      | greek    |   70 |      | Yes |       1 | ISO 8859-7 Greek                                 |
    | greek_general_ci               | greek    |   25 | Yes  | Yes |       1 | ISO 8859-7 Greek                                 |
    | greek_general_nopad_ci         | greek    | 1049 |      | Yes |       1 | ISO 8859-7 Greek                                 |
    | greek_nopad_bin                | greek    | 1094 |      | Yes |       1 | ISO 8859-7 Greek                                 |
    | hebrew_bin                     | hebrew   |   71 |      | Yes |       1 | ISO 8859-8 Hebrew                                |
    | hebrew_general_ci              | hebrew   |   16 | Yes  | Yes |       1 | ISO 8859-8 Hebrew                                |
    | hebrew_general_nopad_ci        | hebrew   | 1040 |      | Yes |       1 | ISO 8859-8 Hebrew                                |
    | hebrew_nopad_bin               | hebrew   | 1095 |      | Yes |       1 | ISO 8859-8 Hebrew                                |
    | hp8_bin                        | hp8      |   72 |      | Yes |       1 | HP West European                                 |
    | hp8_english_ci                 | hp8      |    6 | Yes  | Yes |       1 | HP West European                                 |
    | hp8_english_nopad_ci           | hp8      | 1030 |      | Yes |       1 | HP West European                                 |
    | hp8_nopad_bin                  | hp8      | 1096 |      | Yes |       1 | HP West European                                 |
    | keybcs2_bin                    | keybcs2  |   73 |      | Yes |       1 | DOS Kamenicky Czech-Slovak                       |
    | keybcs2_general_ci             | keybcs2  |   37 | Yes  | Yes |       1 | DOS Kamenicky Czech-Slovak                       |
    | keybcs2_general_nopad_ci       | keybcs2  | 1061 |      | Yes |       1 | DOS Kamenicky Czech-Slovak                       |
    | keybcs2_nopad_bin              | keybcs2  | 1097 |      | Yes |       1 | DOS Kamenicky Czech-Slovak                       |
    | koi8r_bin                      | koi8r    |   74 |      | Yes |       1 | KOI8-R Relcom Russian                            |
    | koi8r_general_ci               | koi8r    |    7 | Yes  | Yes |       1 | KOI8-R Relcom Russian                            |
    | koi8r_general_nopad_ci         | koi8r    | 1031 |      | Yes |       1 | KOI8-R Relcom Russian                            |
    | koi8r_nopad_bin                | koi8r    | 1098 |      | Yes |       1 | KOI8-R Relcom Russian                            |
    | koi8u_bin                      | koi8u    |   75 |      | Yes |       1 | KOI8-U Ukrainian                                 |
    | koi8u_general_ci               | koi8u    |   22 | Yes  | Yes |       1 | KOI8-U Ukrainian                                 |
    | koi8u_general_nopad_ci         | koi8u    | 1046 |      | Yes |       1 | KOI8-U Ukrainian                                 |
    | koi8u_nopad_bin                | koi8u    | 1099 |      | Yes |       1 | KOI8-U Ukrainian                                 |
    | latin1_bin                     | latin1   |   47 |      | Yes |       1 | cp1252 West European                             |
    | latin1_danish_ci               | latin1   |   15 |      | Yes |       1 | cp1252 West European                             |
    | latin1_general_ci              | latin1   |   48 |      | Yes |       1 | cp1252 West European                             |
    | latin1_general_cs              | latin1   |   49 |      | Yes |       1 | cp1252 West European                             |
    | latin1_german1_ci              | latin1   |    5 |      | Yes |       1 | cp1252 West European                             |
    | latin1_german2_ci              | latin1   |   31 |      | Yes |       2 | cp1252 West European                             |
    | latin1_nopad_bin               | latin1   | 1071 |      | Yes |       1 |                                                  |
    | latin1_spanish_ci              | latin1   |   94 |      | Yes |       1 | cp1252 West European                             |
    | latin1_swedish_ci              | latin1   |    8 | Yes  | Yes |       1 | cp1252 West European                             |
    | latin1_swedish_nopad_ci        | latin1   | 1032 |      | Yes |       1 |                                                  |
    | latin2_bin                     | latin2   |   77 |      | Yes |       1 | ISO 8859-2 Central European                      |
    | latin2_croatian_ci             | latin2   |   27 |      | Yes |       1 | ISO 8859-2 Central European                      |
    | latin2_czech_cs                | latin2   |    2 |      | Yes |       4 | ISO 8859-2 Central European                      |
    | latin2_general_ci              | latin2   |    9 | Yes  | Yes |       1 | ISO 8859-2 Central European                      |
    | latin2_general_nopad_ci        | latin2   | 1033 |      | Yes |       1 | ISO 8859-2 Central European                      |
    | latin2_hungarian_ci            | latin2   |   21 |      | Yes |       1 | ISO 8859-2 Central European                      |
    | latin2_nopad_bin               | latin2   | 1101 |      | Yes |       1 | ISO 8859-2 Central European                      |
    | latin5_bin                     | latin5   |   78 |      | Yes |       1 | ISO 8859-9 Turkish                               |
    | latin5_nopad_bin               | latin5   | 1102 |      | Yes |       1 | ISO 8859-9 Turkish                               |
    | latin5_turkish_ci              | latin5   |   30 | Yes  | Yes |       1 | ISO 8859-9 Turkish                               |
    | latin5_turkish_nopad_ci        | latin5   | 1054 |      | Yes |       1 | ISO 8859-9 Turkish                               |
    | latin7_bin                     | latin7   |   79 |      | Yes |       1 | ISO 8859-13 Baltic                               |
    | latin7_estonian_cs             | latin7   |   20 |      | Yes |       1 | ISO 8859-13 Baltic                               |
    | latin7_general_ci              | latin7   |   41 | Yes  | Yes |       1 | ISO 8859-13 Baltic                               |
    | latin7_general_cs              | latin7   |   42 |      | Yes |       1 | ISO 8859-13 Baltic                               |
    | latin7_general_nopad_ci        | latin7   | 1065 |      | Yes |       1 | ISO 8859-13 Baltic                               |
    | latin7_nopad_bin               | latin7   | 1103 |      | Yes |       1 | ISO 8859-13 Baltic                               |
    | macce_bin                      | macce    |   43 |      | Yes |       1 | Mac Central European                             |
    | macce_general_ci               | macce    |   38 | Yes  | Yes |       1 | Mac Central European                             |
    | macce_general_nopad_ci         | macce    | 1062 |      | Yes |       1 | Mac Central European                             |
    | macce_nopad_bin                | macce    | 1067 |      | Yes |       1 | Mac Central European                             |
    | macroman_bin                   | macroman |   53 |      | Yes |       1 | Mac West European                                |
    | macroman_general_ci            | macroman |   39 | Yes  | Yes |       1 | Mac West European                                |
    | macroman_general_nopad_ci      | macroman | 1063 |      | Yes |       1 | Mac West European                                |
    | macroman_nopad_bin             | macroman | 1077 |      | Yes |       1 | Mac West European                                |
    | sjis_bin                       | sjis     |   88 |      | Yes |       1 | Shift-JIS Japanese                               |
    | sjis_japanese_ci               | sjis     |   13 | Yes  | Yes |       1 | Shift-JIS Japanese                               |
    | sjis_japanese_nopad_ci         | sjis     | 1037 |      | Yes |       1 |                                                  |
    | sjis_nopad_bin                 | sjis     | 1112 |      | Yes |       1 |                                                  |
    | swe7_bin                       | swe7     |   82 |      | Yes |       1 | 7bit Swedish                                     |
    | swe7_nopad_bin                 | swe7     | 1106 |      | Yes |       1 | 7bit Swedish                                     |
    | swe7_swedish_ci                | swe7     |   10 | Yes  | Yes |       1 | 7bit Swedish                                     |
    | swe7_swedish_nopad_ci          | swe7     | 1034 |      | Yes |       1 | 7bit Swedish                                     |
    | tis620_bin                     | tis620   |   89 |      | Yes |       1 | TIS620 Thai                                      |
    | tis620_nopad_bin               | tis620   | 1113 |      | Yes |       1 |                                                  |
    | tis620_thai_ci                 | tis620   |   18 | Yes  | Yes |       4 | TIS620 Thai                                      |
    | tis620_thai_nopad_ci           | tis620   | 1042 |      | Yes |       4 |                                                  |
    | uca1400_ai_ci                  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_ai_cs                  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_as_ci                  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_as_cs                  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_ai_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_ai_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_as_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_as_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_nopad_ai_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_nopad_ai_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_nopad_as_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_croatian_nopad_as_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_ai_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_ai_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_as_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_as_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_nopad_ai_ci      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_nopad_ai_cs      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_nopad_as_ci      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_czech_nopad_as_cs      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_ai_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_ai_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_as_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_as_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_nopad_ai_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_nopad_ai_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_nopad_as_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_danish_nopad_as_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_ai_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_ai_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_as_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_as_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_nopad_ai_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_nopad_ai_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_nopad_as_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_esperanto_nopad_as_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_ai_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_ai_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_as_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_as_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_nopad_ai_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_nopad_ai_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_nopad_as_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_estonian_nopad_as_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_german2_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_ai_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_ai_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_as_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_as_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_nopad_ai_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_nopad_ai_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_nopad_as_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_hungarian_nopad_as_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_ai_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_ai_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_as_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_as_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_nopad_ai_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_nopad_ai_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_nopad_as_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_icelandic_nopad_as_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_latvian_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_ai_ci       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_ai_cs       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_as_ci       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_as_cs       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_nopad_ai_ci | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_nopad_ai_cs | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_nopad_as_ci | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_lithuanian_nopad_as_cs | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_nopad_ai_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_nopad_ai_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_nopad_as_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_nopad_as_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_persian_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_ai_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_ai_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_as_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_as_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_nopad_ai_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_nopad_ai_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_nopad_as_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_polish_nopad_as_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_ai_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_ai_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_as_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_as_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_nopad_ai_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_nopad_ai_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_nopad_as_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_romanian_nopad_as_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_ai_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_ai_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_as_ci            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_as_cs            | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_nopad_ai_ci      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_nopad_ai_cs      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_nopad_as_ci      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_roman_nopad_as_cs      | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_sinhala_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_ai_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_ai_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_as_ci           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_as_cs           | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_nopad_ai_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_nopad_ai_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_nopad_as_ci     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovak_nopad_as_cs     | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_ai_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_ai_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_as_ci        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_as_cs        | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_nopad_ai_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_nopad_ai_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_nopad_as_ci  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_slovenian_nopad_as_cs  | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_ai_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_ai_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_as_ci         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_as_cs         | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_nopad_ai_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_nopad_ai_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_nopad_as_ci   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish2_nopad_as_cs   | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_spanish_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_swedish_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_ai_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_ai_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_as_ci          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_as_cs          | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_nopad_ai_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_nopad_ai_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_nopad_as_ci    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_turkish_nopad_as_cs    | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_ai_ci       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_ai_cs       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_as_ci       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_as_cs       | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_nopad_ai_ci | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_nopad_ai_cs | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_nopad_as_ci | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | uca1400_vietnamese_nopad_as_cs | NULL     | NULL | NULL | Yes |       8 |                                                  |
    | ucs2_bin                       | ucs2     |   90 |      | Yes |       1 | UCS-2 Unicode                                    |
    | ucs2_croatian_ci               | ucs2     |  640 |      | Yes |       8 |                                                  |
    | ucs2_croatian_mysql561_ci      | ucs2     |  149 |      | Yes |       8 |                                                  |
    | ucs2_czech_ci                  | ucs2     |  138 |      | Yes |       8 |                                                  |
    | ucs2_danish_ci                 | ucs2     |  139 |      | Yes |       8 |                                                  |
    | ucs2_esperanto_ci              | ucs2     |  145 |      | Yes |       8 |                                                  |
    | ucs2_estonian_ci               | ucs2     |  134 |      | Yes |       8 |                                                  |
    | ucs2_general_ci                | ucs2     |   35 | Yes  | Yes |       1 | UCS-2 Unicode                                    |
    | ucs2_general_mysql500_ci       | ucs2     |  159 |      | Yes |       1 |                                                  |
    | ucs2_general_nopad_ci          | ucs2     | 1059 |      | Yes |       1 |                                                  |
    | ucs2_german2_ci                | ucs2     |  148 |      | Yes |       8 |                                                  |
    | ucs2_hungarian_ci              | ucs2     |  146 |      | Yes |       8 |                                                  |
    | ucs2_icelandic_ci              | ucs2     |  129 |      | Yes |       8 |                                                  |
    | ucs2_latvian_ci                | ucs2     |  130 |      | Yes |       8 |                                                  |
    | ucs2_lithuanian_ci             | ucs2     |  140 |      | Yes |       8 |                                                  |
    | ucs2_myanmar_ci                | ucs2     |  641 |      | Yes |       8 |                                                  |
    | ucs2_nopad_bin                 | ucs2     | 1114 |      | Yes |       1 |                                                  |
    | ucs2_persian_ci                | ucs2     |  144 |      | Yes |       8 |                                                  |
    | ucs2_polish_ci                 | ucs2     |  133 |      | Yes |       8 |                                                  |
    | ucs2_romanian_ci               | ucs2     |  131 |      | Yes |       8 |                                                  |
    | ucs2_roman_ci                  | ucs2     |  143 |      | Yes |       8 |                                                  |
    | ucs2_sinhala_ci                | ucs2     |  147 |      | Yes |       8 |                                                  |
    | ucs2_slovak_ci                 | ucs2     |  141 |      | Yes |       8 |                                                  |
    | ucs2_slovenian_ci              | ucs2     |  132 |      | Yes |       8 |                                                  |
    | ucs2_spanish2_ci               | ucs2     |  142 |      | Yes |       8 |                                                  |
    | ucs2_spanish_ci                | ucs2     |  135 |      | Yes |       8 |                                                  |
    | ucs2_swedish_ci                | ucs2     |  136 |      | Yes |       8 |                                                  |
    | ucs2_thai_520_w2               | ucs2     |  642 |      | Yes |       4 |                                                  |
    | ucs2_turkish_ci                | ucs2     |  137 |      | Yes |       8 |                                                  |
    | ucs2_unicode_520_ci            | ucs2     |  150 |      | Yes |       8 |                                                  |
    | ucs2_unicode_520_nopad_ci      | ucs2     | 1174 |      | Yes |       8 |                                                  |
    | ucs2_unicode_ci                | ucs2     |  128 |      | Yes |       8 |                                                  |
    | ucs2_unicode_nopad_ci          | ucs2     | 1152 |      | Yes |       8 |                                                  |
    | ucs2_vietnamese_ci             | ucs2     |  151 |      | Yes |       8 |                                                  |
    | ujis_bin                       | ujis     |   91 |      | Yes |       1 | EUC-JP Japanese                                  |
    | ujis_japanese_ci               | ujis     |   12 | Yes  | Yes |       1 | EUC-JP Japanese                                  |
    | ujis_japanese_nopad_ci         | ujis     | 1036 |      | Yes |       1 |                                                  |
    | ujis_nopad_bin                 | ujis     | 1115 |      | Yes |       1 |                                                  |
    | utf16le_bin                    | utf16le  |   62 |      | Yes |       1 | UTF-16LE Unicode                                 |
    | utf16le_general_ci             | utf16le  |   56 | Yes  | Yes |       1 | UTF-16LE Unicode                                 |
    | utf16le_general_nopad_ci       | utf16le  | 1080 |      | Yes |       1 | UTF-16LE Unicode                                 |
    | utf16le_nopad_bin              | utf16le  | 1086 |      | Yes |       1 | UTF-16LE Unicode                                 |
    | utf16_bin                      | utf16    |   55 |      | Yes |       1 | UTF-16 Unicode                                   |
    | utf16_croatian_ci              | utf16    |  672 |      | Yes |       8 |                                                  |
    | utf16_croatian_mysql561_ci     | utf16    |  122 |      | Yes |       8 |                                                  |
    | utf16_czech_ci                 | utf16    |  111 |      | Yes |       8 |                                                  |
    | utf16_danish_ci                | utf16    |  112 |      | Yes |       8 |                                                  |
    | utf16_esperanto_ci             | utf16    |  118 |      | Yes |       8 |                                                  |
    | utf16_estonian_ci              | utf16    |  107 |      | Yes |       8 |                                                  |
    | utf16_general_ci               | utf16    |   54 | Yes  | Yes |       1 | UTF-16 Unicode                                   |
    | utf16_general_nopad_ci         | utf16    | 1078 |      | Yes |       1 | UTF-16 Unicode                                   |
    | utf16_german2_ci               | utf16    |  121 |      | Yes |       8 |                                                  |
    | utf16_hungarian_ci             | utf16    |  119 |      | Yes |       8 |                                                  |
    | utf16_icelandic_ci             | utf16    |  102 |      | Yes |       8 |                                                  |
    | utf16_latvian_ci               | utf16    |  103 |      | Yes |       8 |                                                  |
    | utf16_lithuanian_ci            | utf16    |  113 |      | Yes |       8 |                                                  |
    | utf16_myanmar_ci               | utf16    |  673 |      | Yes |       8 |                                                  |
    | utf16_nopad_bin                | utf16    | 1079 |      | Yes |       1 | UTF-16 Unicode                                   |
    | utf16_persian_ci               | utf16    |  117 |      | Yes |       8 |                                                  |
    | utf16_polish_ci                | utf16    |  106 |      | Yes |       8 |                                                  |
    | utf16_romanian_ci              | utf16    |  104 |      | Yes |       8 |                                                  |
    | utf16_roman_ci                 | utf16    |  116 |      | Yes |       8 |                                                  |
    | utf16_sinhala_ci               | utf16    |  120 |      | Yes |       8 |                                                  |
    | utf16_slovak_ci                | utf16    |  114 |      | Yes |       8 |                                                  |
    | utf16_slovenian_ci             | utf16    |  105 |      | Yes |       8 |                                                  |
    | utf16_spanish2_ci              | utf16    |  115 |      | Yes |       8 |                                                  |
    | utf16_spanish_ci               | utf16    |  108 |      | Yes |       8 |                                                  |
    | utf16_swedish_ci               | utf16    |  109 |      | Yes |       8 |                                                  |
    | utf16_thai_520_w2              | utf16    |  674 |      | Yes |       4 |                                                  |
    | utf16_turkish_ci               | utf16    |  110 |      | Yes |       8 |                                                  |
    | utf16_unicode_520_ci           | utf16    |  123 |      | Yes |       8 |                                                  |
    | utf16_unicode_520_nopad_ci     | utf16    | 1147 |      | Yes |       8 |                                                  |
    | utf16_unicode_ci               | utf16    |  101 |      | Yes |       8 |                                                  |
    | utf16_unicode_nopad_ci         | utf16    | 1125 |      | Yes |       8 |                                                  |
    | utf16_vietnamese_ci            | utf16    |  124 |      | Yes |       8 |                                                  |
    | utf32_bin                      | utf32    |   61 |      | Yes |       1 | UTF-32 Unicode                                   |
    | utf32_croatian_ci              | utf32    |  736 |      | Yes |       8 |                                                  |
    | utf32_croatian_mysql561_ci     | utf32    |  181 |      | Yes |       8 |                                                  |
    | utf32_czech_ci                 | utf32    |  170 |      | Yes |       8 |                                                  |
    | utf32_danish_ci                | utf32    |  171 |      | Yes |       8 |                                                  |
    | utf32_esperanto_ci             | utf32    |  177 |      | Yes |       8 |                                                  |
    | utf32_estonian_ci              | utf32    |  166 |      | Yes |       8 |                                                  |
    | utf32_general_ci               | utf32    |   60 | Yes  | Yes |       1 | UTF-32 Unicode                                   |
    | utf32_general_nopad_ci         | utf32    | 1084 |      | Yes |       1 | UTF-32 Unicode                                   |
    | utf32_german2_ci               | utf32    |  180 |      | Yes |       8 |                                                  |
    | utf32_hungarian_ci             | utf32    |  178 |      | Yes |       8 |                                                  |
    | utf32_icelandic_ci             | utf32    |  161 |      | Yes |       8 |                                                  |
    | utf32_latvian_ci               | utf32    |  162 |      | Yes |       8 |                                                  |
    | utf32_lithuanian_ci            | utf32    |  172 |      | Yes |       8 |                                                  |
    | utf32_myanmar_ci               | utf32    |  737 |      | Yes |       8 |                                                  |
    | utf32_nopad_bin                | utf32    | 1085 |      | Yes |       1 | UTF-32 Unicode                                   |
    | utf32_persian_ci               | utf32    |  176 |      | Yes |       8 |                                                  |
    | utf32_polish_ci                | utf32    |  165 |      | Yes |       8 |                                                  |
    | utf32_romanian_ci              | utf32    |  163 |      | Yes |       8 |                                                  |
    | utf32_roman_ci                 | utf32    |  175 |      | Yes |       8 |                                                  |
    | utf32_sinhala_ci               | utf32    |  179 |      | Yes |       8 |                                                  |
    | utf32_slovak_ci                | utf32    |  173 |      | Yes |       8 |                                                  |
    | utf32_slovenian_ci             | utf32    |  164 |      | Yes |       8 |                                                  |
    | utf32_spanish2_ci              | utf32    |  174 |      | Yes |       8 |                                                  |
    | utf32_spanish_ci               | utf32    |  167 |      | Yes |       8 |                                                  |
    | utf32_swedish_ci               | utf32    |  168 |      | Yes |       8 |                                                  |
    | utf32_thai_520_w2              | utf32    |  738 |      | Yes |       4 |                                                  |
    | utf32_turkish_ci               | utf32    |  169 |      | Yes |       8 |                                                  |
    | utf32_unicode_520_ci           | utf32    |  182 |      | Yes |       8 |                                                  |
    | utf32_unicode_520_nopad_ci     | utf32    | 1206 |      | Yes |       8 |                                                  |
    | utf32_unicode_ci               | utf32    |  160 |      | Yes |       8 |                                                  |
    | utf32_unicode_nopad_ci         | utf32    | 1184 |      | Yes |       8 |                                                  |
    | utf32_vietnamese_ci            | utf32    |  183 |      | Yes |       8 |                                                  |
    | utf8mb3_bin                    | utf8mb3  |   83 |      | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb3_croatian_ci            | utf8mb3  |  576 |      | Yes |       8 |                                                  |
    | utf8mb3_croatian_mysql561_ci   | utf8mb3  |  213 |      | Yes |       8 |                                                  |
    | utf8mb3_czech_ci               | utf8mb3  |  202 |      | Yes |       8 |                                                  |
    | utf8mb3_danish_ci              | utf8mb3  |  203 |      | Yes |       8 |                                                  |
    | utf8mb3_esperanto_ci           | utf8mb3  |  209 |      | Yes |       8 |                                                  |
    | utf8mb3_estonian_ci            | utf8mb3  |  198 |      | Yes |       8 |                                                  |
    | utf8mb3_general_ci             | utf8mb3  |   33 | Yes  | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb3_general_mysql500_ci    | utf8mb3  |  223 |      | Yes |       1 |                                                  |
    | utf8mb3_general_nopad_ci       | utf8mb3  | 1057 |      | Yes |       1 |                                                  |
    | utf8mb3_german2_ci             | utf8mb3  |  212 |      | Yes |       8 |                                                  |
    | utf8mb3_hungarian_ci           | utf8mb3  |  210 |      | Yes |       8 |                                                  |
    | utf8mb3_icelandic_ci           | utf8mb3  |  193 |      | Yes |       8 |                                                  |
    | utf8mb3_latvian_ci             | utf8mb3  |  194 |      | Yes |       8 |                                                  |
    | utf8mb3_lithuanian_ci          | utf8mb3  |  204 |      | Yes |       8 |                                                  |
    | utf8mb3_myanmar_ci             | utf8mb3  |  577 |      | Yes |       8 |                                                  |
    | utf8mb3_nopad_bin              | utf8mb3  | 1107 |      | Yes |       1 |                                                  |
    | utf8mb3_persian_ci             | utf8mb3  |  208 |      | Yes |       8 |                                                  |
    | utf8mb3_polish_ci              | utf8mb3  |  197 |      | Yes |       8 |                                                  |
    | utf8mb3_romanian_ci            | utf8mb3  |  195 |      | Yes |       8 |                                                  |
    | utf8mb3_roman_ci               | utf8mb3  |  207 |      | Yes |       8 |                                                  |
    | utf8mb3_sinhala_ci             | utf8mb3  |  211 |      | Yes |       8 |                                                  |
    | utf8mb3_slovak_ci              | utf8mb3  |  205 |      | Yes |       8 |                                                  |
    | utf8mb3_slovenian_ci           | utf8mb3  |  196 |      | Yes |       8 |                                                  |
    | utf8mb3_spanish2_ci            | utf8mb3  |  206 |      | Yes |       8 |                                                  |
    | utf8mb3_spanish_ci             | utf8mb3  |  199 |      | Yes |       8 |                                                  |
    | utf8mb3_swedish_ci             | utf8mb3  |  200 |      | Yes |       8 |                                                  |
    | utf8mb3_thai_520_w2            | utf8mb3  |  578 |      | Yes |       4 |                                                  |
    | utf8mb3_turkish_ci             | utf8mb3  |  201 |      | Yes |       8 |                                                  |
    | utf8mb3_unicode_520_ci         | utf8mb3  |  214 |      | Yes |       8 |                                                  |
    | utf8mb3_unicode_520_nopad_ci   | utf8mb3  | 1238 |      | Yes |       8 |                                                  |
    | utf8mb3_unicode_ci             | utf8mb3  |  192 |      | Yes |       8 |                                                  |
    | utf8mb3_unicode_nopad_ci       | utf8mb3  | 1216 |      | Yes |       8 |                                                  |
    | utf8mb3_vietnamese_ci          | utf8mb3  |  215 |      | Yes |       8 |                                                  |
    | utf8mb4_0900_ai_ci             | utf8mb4  |  255 |      | Yes |       8 | Alias for utf8mb4_uca1400_nopad_ai_ci            |
    | utf8mb4_0900_as_ci             | utf8mb4  |  305 |      | Yes |       8 | Alias for utf8mb4_uca1400_nopad_as_ci            |
    | utf8mb4_0900_as_cs             | utf8mb4  |  278 |      | Yes |       8 | Alias for utf8mb4_uca1400_nopad_as_cs            |
    | utf8mb4_0900_bin               | utf8mb4  |  309 |      | Yes |       1 | Alias for utf8mb4_bin                            |
    | utf8mb4_bin                    | utf8mb4  |   46 |      | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb4_croatian_ci            | utf8mb4  |  608 |      | Yes |       8 |                                                  |
    | utf8mb4_croatian_mysql561_ci   | utf8mb4  |  245 |      | Yes |       8 |                                                  |
    | utf8mb4_cs_0900_ai_ci          | utf8mb4  |  266 |      | Yes |       8 | Alias for utf8mb4_uca1400_czech_nopad_ai_ci      |
    | utf8mb4_cs_0900_as_cs          | utf8mb4  |  289 |      | Yes |       8 | Alias for utf8mb4_uca1400_czech_nopad_as_cs      |
    | utf8mb4_czech_ci               | utf8mb4  |  234 |      | Yes |       8 |                                                  |
    | utf8mb4_danish_ci              | utf8mb4  |  235 |      | Yes |       8 |                                                  |
    | utf8mb4_da_0900_ai_ci          | utf8mb4  |  267 |      | Yes |       8 | Alias for utf8mb4_uca1400_danish_nopad_ai_ci     |
    | utf8mb4_da_0900_as_cs          | utf8mb4  |  290 |      | Yes |       8 | Alias for utf8mb4_uca1400_danish_nopad_as_cs     |
    | utf8mb4_de_pb_0900_ai_ci       | utf8mb4  |  256 |      | Yes |       8 | Alias for utf8mb4_uca1400_german2_nopad_ai_ci    |
    | utf8mb4_de_pb_0900_as_cs       | utf8mb4  |  279 |      | Yes |       8 | Alias for utf8mb4_uca1400_german2_nopad_as_cs    |
    | utf8mb4_eo_0900_ai_ci          | utf8mb4  |  273 |      | Yes |       8 | Alias for utf8mb4_uca1400_esperanto_nopad_ai_ci  |
    | utf8mb4_eo_0900_as_cs          | utf8mb4  |  296 |      | Yes |       8 | Alias for utf8mb4_uca1400_esperanto_nopad_as_cs  |
    | utf8mb4_esperanto_ci           | utf8mb4  |  241 |      | Yes |       8 |                                                  |
    | utf8mb4_estonian_ci            | utf8mb4  |  230 |      | Yes |       8 |                                                  |
    | utf8mb4_es_0900_ai_ci          | utf8mb4  |  263 |      | Yes |       8 | Alias for utf8mb4_uca1400_spanish_nopad_ai_ci    |
    | utf8mb4_es_0900_as_cs          | utf8mb4  |  286 |      | Yes |       8 | Alias for utf8mb4_uca1400_spanish_nopad_as_cs    |
    | utf8mb4_es_trad_0900_ai_ci     | utf8mb4  |  270 |      | Yes |       8 | Alias for utf8mb4_uca1400_spanish2_nopad_ai_ci   |
    | utf8mb4_es_trad_0900_as_cs     | utf8mb4  |  293 |      | Yes |       8 | Alias for utf8mb4_uca1400_spanish2_nopad_as_cs   |
    | utf8mb4_et_0900_ai_ci          | utf8mb4  |  262 |      | Yes |       8 | Alias for utf8mb4_uca1400_estonian_nopad_ai_ci   |
    | utf8mb4_et_0900_as_cs          | utf8mb4  |  285 |      | Yes |       8 | Alias for utf8mb4_uca1400_estonian_nopad_as_cs   |
    | utf8mb4_general_ci             | utf8mb4  |   45 | Yes  | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb4_general_nopad_ci       | utf8mb4  | 1069 |      | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb4_german2_ci             | utf8mb4  |  244 |      | Yes |       8 |                                                  |
    | utf8mb4_hr_0900_ai_ci          | utf8mb4  |  275 |      | Yes |       8 | Alias for utf8mb4_uca1400_croatian_nopad_ai_ci   |
    | utf8mb4_hr_0900_as_cs          | utf8mb4  |  298 |      | Yes |       8 | Alias for utf8mb4_uca1400_croatian_nopad_as_cs   |
    | utf8mb4_hungarian_ci           | utf8mb4  |  242 |      | Yes |       8 |                                                  |
    | utf8mb4_hu_0900_ai_ci          | utf8mb4  |  274 |      | Yes |       8 | Alias for utf8mb4_uca1400_hungarian_nopad_ai_ci  |
    | utf8mb4_hu_0900_as_cs          | utf8mb4  |  297 |      | Yes |       8 | Alias for utf8mb4_uca1400_hungarian_nopad_as_cs  |
    | utf8mb4_icelandic_ci           | utf8mb4  |  225 |      | Yes |       8 |                                                  |
    | utf8mb4_is_0900_ai_ci          | utf8mb4  |  257 |      | Yes |       8 | Alias for utf8mb4_uca1400_icelandic_nopad_ai_ci  |
    | utf8mb4_is_0900_as_cs          | utf8mb4  |  280 |      | Yes |       8 | Alias for utf8mb4_uca1400_icelandic_nopad_as_cs  |
    | utf8mb4_latvian_ci             | utf8mb4  |  226 |      | Yes |       8 |                                                  |
    | utf8mb4_la_0900_ai_ci          | utf8mb4  |  271 |      | Yes |       8 | Alias for utf8mb4_uca1400_roman_nopad_ai_ci      |
    | utf8mb4_la_0900_as_cs          | utf8mb4  |  294 |      | Yes |       8 | Alias for utf8mb4_uca1400_roman_nopad_as_cs      |
    | utf8mb4_lithuanian_ci          | utf8mb4  |  236 |      | Yes |       8 |                                                  |
    | utf8mb4_lt_0900_ai_ci          | utf8mb4  |  268 |      | Yes |       8 | Alias for utf8mb4_uca1400_lithuanian_nopad_ai_ci |
    | utf8mb4_lt_0900_as_cs          | utf8mb4  |  291 |      | Yes |       8 | Alias for utf8mb4_uca1400_lithuanian_nopad_as_cs |
    | utf8mb4_lv_0900_ai_ci          | utf8mb4  |  258 |      | Yes |       8 | Alias for utf8mb4_uca1400_latvian_nopad_ai_ci    |
    | utf8mb4_lv_0900_as_cs          | utf8mb4  |  281 |      | Yes |       8 | Alias for utf8mb4_uca1400_latvian_nopad_as_cs    |
    | utf8mb4_myanmar_ci             | utf8mb4  |  609 |      | Yes |       8 |                                                  |
    | utf8mb4_nopad_bin              | utf8mb4  | 1070 |      | Yes |       1 | UTF-8 Unicode                                    |
    | utf8mb4_persian_ci             | utf8mb4  |  240 |      | Yes |       8 |                                                  |
    | utf8mb4_pl_0900_ai_ci          | utf8mb4  |  261 |      | Yes |       8 | Alias for utf8mb4_uca1400_polish_nopad_ai_ci     |
    | utf8mb4_pl_0900_as_cs          | utf8mb4  |  284 |      | Yes |       8 | Alias for utf8mb4_uca1400_polish_nopad_as_cs     |
    | utf8mb4_polish_ci              | utf8mb4  |  229 |      | Yes |       8 |                                                  |
    | utf8mb4_romanian_ci            | utf8mb4  |  227 |      | Yes |       8 |                                                  |
    | utf8mb4_roman_ci               | utf8mb4  |  239 |      | Yes |       8 |                                                  |
    | utf8mb4_ro_0900_ai_ci          | utf8mb4  |  259 |      | Yes |       8 | Alias for utf8mb4_uca1400_romanian_nopad_ai_ci   |
    | utf8mb4_ro_0900_as_cs          | utf8mb4  |  282 |      | Yes |       8 | Alias for utf8mb4_uca1400_romanian_nopad_as_cs   |
    | utf8mb4_sinhala_ci             | utf8mb4  |  243 |      | Yes |       8 |                                                  |
    | utf8mb4_sk_0900_ai_ci          | utf8mb4  |  269 |      | Yes |       8 | Alias for utf8mb4_uca1400_slovak_nopad_ai_ci     |
    | utf8mb4_sk_0900_as_cs          | utf8mb4  |  292 |      | Yes |       8 | Alias for utf8mb4_uca1400_slovak_nopad_as_cs     |
    | utf8mb4_slovak_ci              | utf8mb4  |  237 |      | Yes |       8 |                                                  |
    | utf8mb4_slovenian_ci           | utf8mb4  |  228 |      | Yes |       8 |                                                  |
    | utf8mb4_sl_0900_ai_ci          | utf8mb4  |  260 |      | Yes |       8 | Alias for utf8mb4_uca1400_slovenian_nopad_ai_ci  |
    | utf8mb4_sl_0900_as_cs          | utf8mb4  |  283 |      | Yes |       8 | Alias for utf8mb4_uca1400_slovenian_nopad_as_cs  |
    | utf8mb4_spanish2_ci            | utf8mb4  |  238 |      | Yes |       8 |                                                  |
    | utf8mb4_spanish_ci             | utf8mb4  |  231 |      | Yes |       8 |                                                  |
    | utf8mb4_sv_0900_ai_ci          | utf8mb4  |  264 |      | Yes |       8 | Alias for utf8mb4_uca1400_swedish_nopad_ai_ci    |
    | utf8mb4_sv_0900_as_cs          | utf8mb4  |  287 |      | Yes |       8 | Alias for utf8mb4_uca1400_swedish_nopad_as_cs    |
    | utf8mb4_swedish_ci             | utf8mb4  |  232 |      | Yes |       8 |                                                  |
    | utf8mb4_thai_520_w2            | utf8mb4  |  610 |      | Yes |       4 |                                                  |
    | utf8mb4_tr_0900_ai_ci          | utf8mb4  |  265 |      | Yes |       8 | Alias for utf8mb4_uca1400_turkish_nopad_ai_ci    |
    | utf8mb4_tr_0900_as_cs          | utf8mb4  |  288 |      | Yes |       8 | Alias for utf8mb4_uca1400_turkish_nopad_as_cs    |
    | utf8mb4_turkish_ci             | utf8mb4  |  233 |      | Yes |       8 |                                                  |
    | utf8mb4_unicode_520_ci         | utf8mb4  |  246 |      | Yes |       8 |                                                  |
    | utf8mb4_unicode_520_nopad_ci   | utf8mb4  | 1270 |      | Yes |       8 |                                                  |
    | utf8mb4_unicode_ci             | utf8mb4  |  224 |      | Yes |       8 |                                                  |
    | utf8mb4_unicode_nopad_ci       | utf8mb4  | 1248 |      | Yes |       8 |                                                  |
    | utf8mb4_vietnamese_ci          | utf8mb4  |  247 |      | Yes |       8 |                                                  |
    | utf8mb4_vi_0900_ai_ci          | utf8mb4  |  277 |      | Yes |       8 | Alias for utf8mb4_uca1400_vietnamese_nopad_ai_ci |
    | utf8mb4_vi_0900_as_cs          | utf8mb4  |  300 |      | Yes |       8 | Alias for utf8mb4_uca1400_vietnamese_nopad_as_cs |
    +--------------------------------+----------+------+------+-----+---------+--------------------------------------------------+
    550 rows in set (0.005 sec)
    SELECT collation_name FROM information_schema.COLLATIONS
    WHERE collation_name LIKE "%nopad%";  
    +------------------------------+
    | collation_name               |
    +------------------------------+
    | big5_chinese_nopad_ci        |
    | big5_nopad_bin               |
    ...
    ...
    | uca1400_spanish2_ai_ci         |
    | uca1400_spanish2_ai_cs         |
    | uca1400_spanish2_as_ci         |
    | uca1400_spanish2_as_cs         |
    ...
    OLD_MODE
    Oracle mode
    Oracle mode
    Oracle mode
    Oracle mode
    MariaDB 10.10
    MariaDB 10.5
    Oracle mode
    Oracle mode
    MariaDB 10.5.7
    Oracle mode
    Oracle mode
    10.10
    MariaDB 10.4.25
    10.5.16
    10.7.4
    10.8.3
    MariaDB 11.1.2
    ColumnStore
    Oracle mode
    Oracle mode from MariaDB 10.3
    MariaDB 10.11.3
    MariaDB 10.0.11
    MariaDB 10.3.0
    MariaDB 11.1.2
    MariaDB 11.4.5
    MariaDB 10.10.1
    MariaDB 10.6.1
    MariaDB 11.4.5
    MariaDB 10.10
    MariaDB 10.10
    MariaDB 10.6.1
    MariaDB 10.2.2
    MariaDB 10.1.15
    MariaDB 10.0.7
    MariaDB 10.0.5
    MariaDB 5.1.41
    MariaDB 11.5
    MariaDB 11.4
    MariaDB 11.5
    MariaDB 11.4
    MariaDB 11.5
    MariaDB 11.4
    MariaDB 11.5
    MariaDB 11.4
    MariaDB 11.5