Closed fanjindong closed 5 years ago
Default use utf-8
, you can custom DB_URL
in local_settings.py, like this:
DB_URL = 'mysql+pymysql://user:pass@1.2.3.4/database?charset=utf8mb4'
I have modified, this
DB_URL = 'mysql://root:fanjindong@127.0.0.1:3306/blog?charset=utf8mb4'
But still error
tortoise.exceptions.OperationalError: (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='")
and show variables like "%char%";
result is :
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database latin1
character_set_filesystem binary
character_set_results utf8mb4
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
Can https://stackoverflow.com/a/1008336 help you?
错误如下,难道mysql不能用
utf8mb4_general_ci
?