插入后可能需要提交。此链接表示mysql python连接器不会自动提交。
https://dev.mysql.com/doc/connector-python/en/connector-python-api-mysqlconnection-commit.html
可以在for循环之后使用inserts执行connection.commit()。