noobdummy / blog

MIT License
0 stars 0 forks source link

mariadb设置字符集为utf8mb4 #7

Open noobdummy opened 4 years ago

noobdummy commented 4 years ago
[client]
...
default-character-set=utf8mb4
...
[mysql]
...
default-character-set=utf8mb4
...
[mysqld]
...
collation-server = utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci'
character-set-server = utf8mb4
character-set-client-handshake=FALSE
...
SHOW VARIABLES WHERE Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';

https://mariadb.com/kb/en/setting-character-sets-and-collations/#example-changing-the-default-character-set-to-utf-8

https://mathiasbynens.be/notes/mysql-utf8mb4#utf8-to-utf8mb4