hrh47 / blog

0 stars 0 forks source link

如何更改 mysql 預設的字元編碼? #4

Open hrh47 opened 5 years ago

hrh47 commented 5 years ago

更改 /etc/mysql/my.cnf,增加這些設定:

[mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci

[client] default-character-set=utf8mb4

[mysql] default-character-set=utf8mb4

hrh47 commented 5 years ago

MySQL 將預設資料庫編碼 latin1 改為 UTF8

再见乱码:5分钟读懂MySQL字符集设置