修改 /etc/my.cnf

1
2
3
4
5
6
7
8
9
10
11
[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'

代码中

tomcat 6 + 、jetty 6 + 均在内部支持emoji,无须做任何代码上的修改即可