MySql 保存微信昵称 emoji表情

版权声明: https://blog.csdn.net/famouszhouxp/article/details/80109420

一、用哪里改哪里

1、改数据库

ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

2、改表

ALTER TABLE  table_name  CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;


3、改字段

ALTER TABLE tb_name  CHANGE nickname  nickname VARCHAR(50) CHARACTER SET utf8mb4   COLLATE utf8mb4_unicode_ci


二、修改配置文件

[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'


三、重启mysql服务器

启动mysql :service mysql start 

重启mysql: service mysqld restart



阅读更多
换一批

没有更多推荐了,返回首页