What is the difference between utf8mb4 and UTF-8 charsets in MySQL?

What is the difference between utf8mb4 and UTF-8 charsets in MySQL?

For a BMP character, utf8[/utf8mb3] and utf8mb4 have identical storage characteristics: same code values, same encoding, same length. For a supplementary character, utf8[/utf8mb3] cannot store the character at all, while utf8mb4 requires four bytes to store it.

What character set should I use MySQL?

It is best to use character set utf8mb4 with the collation utf8mb4_unicode_ci . The character set, utf8 , only supports a small amount of UTF-8 code points, about 6% of possible characters. utf8 only supports the Basic Multilingual Plane (BMP).

Is Base64 ASCII or UTF-8?

In programming, Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in an ASCII string format by translating the data into a radix-64 representation.

Which is the collation for utf8mb4 in MySQL?

Each character set has a default collation. For example, the default collations for utf8mb4 and latin1 are utf8mb4_0900_ai_ci and latin1_swedish_ci, respectively. The INFORMATION_SCHEMA CHARACTER_SETS table and the SHOW CHARACTER SET statement indicate the default collation for each character set.

What’s the difference between utf8mb4 _ Unicode _ CI and Unicode general?

utf8mb4_unicode_ci is based on the official Unicode rules for universal sorting and comparison, which sorts accurately in a wide range of languages. utf8mb4_general_ci is a simplified set of sorting rules which aims to do as well as it can while taking many short-cuts designed to improve speed.

What’s the maximum length of a utf8mb4 character?

A utf8mb4 character use 1-4 bytes, which means that the maximum length of a char/varchar column that is a key, will be 767 characters. So if you have key varchar/char columns with lengths larger than 767 characters you will have to consider either to shorten the length, change to TEXT or change the InnoDB settings.

Which is character set should you use in MySQL?

Some of the changes include: The UCA 9.0.0 collations (with 0900 in the name) are new in MySQL 8.0. MySQL works faster with these new collations than the old collations. In-memory internal temporary tables now use the new Temptable storage engine by default.