Bug #82349 charset utf8mb4 is missing from /usr/share/mysql/charsets/Index.xml
Submitted: 26 Jul 2016 19:10 Modified: 28 Mar 2018 8:59
Reporter: Jonathan Nicol Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.5, 5.6 OS:Linux
Assigned to: CPU Architecture:Any
Tags: server charset utf8mb4

[26 Jul 2016 19:10] Jonathan Nicol
Description:
/usr/share/mysql/charsets/Index.xml which is bundled with MySQL-server is missing the character set utf8mb4. This causes perl-DBD-MySQL (and probably other clients) to fail when the character set is forced to utf8mb4. According to documentation utf8mb4 has been supported since 5.5.3, so this must be an oversight.

How to repeat:
# grep utf8 /etc/my.cnf
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
default-character-set = utf8mb4
default-character-set = utf8mb4

# pt-show-grants 
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

Suggested fix:
Add utf8mb4 to the character set definitions.
[29 Jun 2017 8:38] zhang jianwei
Any update? how can we add utf8mb4 into /usr/share/mysql/charsets/Index.xml ?

Any detail steps?
[8 Aug 2017 23:58] Madison Smith
Same issue after upgrading to gitlab 8.16 (source not omnibus which uses postgresql).

After connected to MySQL, you can even see the collation by running:
SHOW COLLATION WHERE Collation = 'utf8mb4_general_ci';
+--------------------+---------+----+---------+----------+---------+
| Collation          | Charset | Id | Default | Compiled | Sortlen |
+--------------------+---------+----+---------+----------+---------+
| utf8mb4_general_ci | utf8mb4 | 45 | Yes     | Yes      |       1 |
+--------------------+---------+----+---------+----------+---------+

but /usr/share/MySQL/charsets/Index.xml has no such entry for the "utf8mb4_general_ci" collation or anything "utf8mb4". We need a fix ASAP! Gitlab isn't able to run because of this.
[22 Mar 2018 23:37] MySQL Verification Team
The UTF8MB4 it's a compiled charset:

 Your MySQL connection id is 1
Server version: 5.5.59 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.5 > SHOW CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
| Charset  | Description                 | Default collation   | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5     | Big5 Traditional Chinese    | big5_chinese_ci     |      2 |
<CUT>
| latin7   | ISO 8859-13 Baltic          | latin7_general_ci   |      1 |
| utf8mb4  | UTF-8 Unicode               | utf8mb4_general_ci  |      4 |
| cp1251   | Windows Cyrillic            | cp1251_general_ci   |      1 |
<CUT>
| eucjpms  | UJIS for Windows Japanese   | eucjpms_japanese_ci |      3 |
+----------+-----------------------------+---------------------+--------+
39 rows in set (0.20 sec)

mysql 5.5 > 

miguel@tikal:~/build/2018MAR08/mysql-5.5 $ cat cmake/character_sets.cmake 
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
<CUT>
SET(CHARSETS_AVAILABLE 
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
greek hebrew hp8 keybcs2 koi8r koi8u
latin1 latin2 latin5 latin7 macce macroman
sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)

SET (EXTRA_CHARSETS "all")
SET(WITH_EXTRA_CHARSETS ${EXTRA_CHARSETS} CACHE 
  STRING "Options are: none, complex, all")

IF(WITH_EXTRA_CHARSETS MATCHES "complex")
  SET(CHARSETS ${CHARSETS} ${CHARSETS_COMPLEX})
ELSEIF(WITH_EXTRA_CHARSETS MATCHES "all")
 <CUT>
[26 Mar 2018 21:17] Jonathan Nicol
Please re-read the bug report. This is not about compiled-in support, it's about the character set being missing from the XML list of supported character sets, in packages distributed by MySQL.

$ rpm -qf /usr/share/mysql/charsets/Index.xml
MySQL-server-5.5.59-1.el7.x86_64
$ grep -Hir utf8mb4 /usr/share/mysql/charsets/*
$

$ rpm -qf /usr/share/mysql/charsets/Index.xml
MySQL-server-5.6.31-1.el7.x86_64
$ grep -Hir utf8mb4 /usr/share/mysql/charsets/*
$
[28 Mar 2018 8:59] MySQL Verification Team
Thank you for the feedback.