2
我在Windows 7機器上安裝了MySQL 5.7。 我需要更改數據庫的字符集才能保留表情符號。如何在MySQL 5.7上設置utf8mb4(windows)
配置成的my.ini:
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
default-character-set = utf8mb4
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
進入我看到加載的配置文件的路徑是正確的窗口服務。
展望數據庫屬性與查詢:
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
我得到了以下結果:
Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database utf8mb4
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
collation_connection utf8_general_ci
collation_database utf8mb4_general_ci
collation_server utf8_general_ci
所以,collation_server的,character_set_system,被character_set_server,character_set_results,是character_set_connection,character_set_client字符的值是錯誤的。
我該如何解決它們? 謝謝。