-
问题描述
在Python使用pymysql出现如题错误:
/home/data/anaconda3/lib/python3.7/site-packages/pymysql/cursors.py:170: Warning: (3719, "'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.")
-
解决方案
MySQL中的
“utf8”
并不是真正的UTF-8
。“utf8”
只支持每个字符最多三个字节,而真正的UTF-8
是每个字符最多四个字节。MySQL一直没有修复这个bug,他们在2010年发布了一个叫作
“utf8mb4”
的字符集,绕过了这个问题。MySQL中的utf8mb4是真正的utf8,所以用utf8mb4,不要用utf8这个别名。
-
References
Warning: (3719, "'utf8' is currently an alias for the character set UTF8MB3, but will be an alias
猜你喜欢
转载自blog.csdn.net/The_Time_Runner/article/details/105446599
今日推荐
周排行