I'm trying to convert my DB to utf8mb4
following this guide. I have set:
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
init-connect='SET NAMES utf8mb4'
collation_server=utf8mb4_unicode_ci
character_set_server=utf8mb4
skip-character-set-client-handshake
But the value of character_set_client
and character_set_results
still won't change to utf8mb4.
mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
What am I doing wrong? How do I get those values set to utf8mb4?
Best Answer
Disclosure: I’m the author of How to support full Unicode in MySQL databases, the guide you’re following.
Where did you save the modified settings? Check where
mysqld
loads the default options from. It’s usually/etc/my.cnf
(as mentioned in the guide) but it may be different on your system. Run the following command to find out:Did you restart
mysqld
by runningmysqld restart
after making the changes?