时间:2021-07-01 10:21:17 帮助过:30人阅读
b.设置库的字符集为UTF8mb4
2.如果是自己mysql服务器
[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 init_connect=‘SET NAMES utf8mb4‘
3.修改数据表还有字段
ALTER TABLE `user` MODIFY COLUMN nickname VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; ALTER TABLE `user` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
4.修改库连接
‘charset‘ => ‘utf8mb4‘,
MySQL 存储 utf8mb4
标签:nbsp margin border nic order var class convert font