数据库需要支持utf8mb4,如果已经创建了,那么可以用如下命令转换:
alter database xxxx character set utf8mb4 collate utf8mb4_unicode_ci;
alter table xxxx convert to character set utf8mb4 collate utf8mb4_unicode_ci;连接字符串的charset要指定为utf8mb4
转载于:https://www.cnblogs.com/ilovewindy/p/4726786.html