collat​​ion utf8mb4_unicode_ci 是什么意思

What does collation utf8mb4_unicode_ci mean

我正在做一个项目,想实现一个类似于 wordpress 帖子 table 的帖子 table 来存储页面内容。

所以我基本上复制了 wp_posts table 这是 longtext 但是我注意到在整理下它有 utf8mb4_unicode_ci

我想知道这是什么意思,有什么必要?

utf8mb4_unicode_ci 在 mysql 数据库中支持完整的 unicode。

可以在此处找到更多信息https://mathiasbynens.be/notes/mysql-utf8mb4

基本上Unicode中有很多字符无法用utf8存储在table中,从而导致数据丢失。

UTF-8 符号占用 1 到 3 个字节,但有些符号甚至可以占用 4 个字节,但这些符号不受支持 (utf8 - utf8mb4)。

在 wordpress 中,这种从 utf8 排序规则的变化导致了一些用户的问题,主要是因为 utf8mb4_unicode_ci 仅在 MySQL 5.5.3+ 中受支持。