将MySQL默认字符集改为utf8mb4
查看当前默认字符集
mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
进入mysql配置文件
;设置字符集为utf8mb4
[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
重启服务即可;
对于已经存在的表需要单独进行修改;
更多迁移计划可以参考:
https://mathiasbynens.be/notes/mysql-utf8mb4#utf8-to-utf8mb4
欢迎关注公-众-号【TaonyDaily】、留言、评论,一起学习。
Don’t reinvent the wheel, library code is there to help.
文章来源:刘俊涛的博客
若有帮助到您,欢迎点赞、转发、支持,您的支持是对我坚持最好的肯定(_)
标签:set,utf8mb4,字符集,MySQL,character,mysql From: https://www.cnblogs.com/lovebing/p/17639605.html