sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1267, "Illegal mix of collations (lati...

这个bug是因为数据库编码格式不统一导致的

解决方法:

1. SHOW VARIABLES LIKE 'character_set_%';

2.SHOW VARIABLES LIKE 'collation_%';

3.

set character_set_database = utf8;

set character_set_results = utf8;

set character_set_server = utf8;

set character_set_system = utf8;

set collation_server = utf8_general_ci;

set collation_database = utf8_general_ci;

4.查看每张表的编码格式

show create table 表名;

5.更改每一张表编码格式

alter table 表名 convert to character set utf8mb4 collate utf8mb4_bin;

6.重启数据库

ok!

你可能感兴趣的:(sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1267, "Illegal mix of collations (lati...)