3

I want to change character_set_connection utf8mb4. Its showing me utf8. I have follow this https://mathiasbynens.be/notes/mysql-utf8mb4 article and changed


[client]
default-character-set = utf8mb4

[mysql] default-character-set = utf8mb4

[mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci

Also fire this query.
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
but when I check current status in phpmyadmin using
SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
result

character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci

I have set alter tables and database

SET NAMES utf8mb4;  
ALTER DATABASE openfire CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;  
ALTER TABLE ofOffline CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 

This is my connections string

jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&useUnicode=true
MySQL 5.6.33 I have check in windows with version 5.7.14 it's fine. Please give me any suggestions. Thanks in advance.

0

What client are you using? You will need to specify that the connection is to be with utf8mb4.

What about the tables? If you have existing tables, an ALTER ... CONVERT TO will be needed.

0

Community wiki answer based on a comment originally left by the question author:

Finally I solved this issue. The problem is in phpmyadmin: I can see those character_set_client using MySQL query in putty command but still not in phpmyadmin.

It's a bug in phpmyadmin as mentioned in How to support full Unicode in MySQL databases by Mathias Bynens.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.