编码问题 在mysql中写如下查询 alter table 表名 convert to character set utf8mb4 collate utf8mb4_bin; 数据不显示问题 明明执行成功了,发现数据库中没有数据 是因为没有提交查询 在最后加上这句话即可 conn.commit()