Database names created with 4-byte characters displayed as ???
Posted by: Jennifer Roos
Date: December 10, 2015 12:50PM

I am testing with MySQL using UTF8MB4, and while I have gotten most things to work, am running into an issue with database names that I have created using 4-byte Traditional Chinese characters. When I do a show databases it displays databases with 3-byte characters correctly, but all 4-byte ones are shown with ????. If, however, I try to recreate a database using the same Traditional Chinese characters, it indicates that it already exists.

I am wondering if the problem is that the server was originally setup with out the utf8mb4 settings, so that DEFAULT_CHARACTER_SET_NAME for information_schema is utf8 and DEFAULT_COLLATION_NAME for information_schema is utf8_general_ci. I'm assuming this is why I cannot see 4-byte characters for those database names.

My Main Question ===> Is there anyway to convert this, or would I have to start over and recreate all of the MySQL base tables?

My server settings are as follows:
mysql> show global variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+-------------------------

mysql> show global variables like '%coll%';
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+----------------------+--------------------+

Here are some example rows from my SCHEMATA table in information_schema. The 3-byte Korean characters display fine (last 2 rows), but the 4-byte Chinese characters are just '?'

mysql> select * from SCHEMATA;
+--------------+---------------------+----------------------------+------------------------+----------+
| CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |
+--------------+---------------------+----------------------------+------------------------+----------+
| def | information_schema | utf8 | utf8_general_ci | NULL |
| def | ? | utf8mb4 | utf8mb4_unicode_ci | NULL |
| def | ????? | utf8mb4 | utf8mb4_unicode_ci | NULL |
| def | 갗갗 | utf8mb4 | utf8mb4_unicode_ci | NULL |
| def | 괩괩 | utf8mb4 | utf8mb4_unicode_ci | NULL |
+--------------+---------------------+----------------------------+------------------------+----------+

Options: ReplyQuote


Subject
Views
Written By
Posted
Database names created with 4-byte characters displayed as ???
1682
December 10, 2015 12:50PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.