1.在创建连接的位置设置字符编码
mysql = 'mysql+pymysql://root:@localhost:3306/test?charset=utf8mb4'
tableName = 'persons1'
engine = create_engine(mysql,encoding='utf8')
2.修改Mysql编码格式
show variables like 'character%';
s
1.在创建连接的位置设置字符编码
mysql = 'mysql+pymysql://root:@localhost:3306/test?charset=utf8mb4'
tableName = 'persons1'
engine = create_engine(mysql,encoding='utf8')
2.修改Mysql编码格式
show variables like 'character%';
s