Open weihomechen opened 6 years ago
如果执行完sql文件发现插入emoji表情报错,需要设置字符集为utf8mb4
utf8mb4
1、 先停止MySQLServer服务
service mysql stop
2、修改 my.cnf或者mysql.ini:
my.cnf
mysql.ini
[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、然后重启 service mysql restart
service mysql restart
4、进入mysql,查看相关字符集:SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
如果执行完sql文件发现插入emoji表情报错,需要设置字符集为
utf8mb4
1、 先停止MySQLServer服务
service mysql stop
2、修改
my.cnf
或者mysql.ini
:3、然后重启
service mysql restart
4、进入mysql,查看相关字符集:
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';