![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mysql
Tools-lqp
这个作者很懒,什么都没留下…
展开
-
python2 用pymysql代替MySQLdb
安装 pymysqlpip install pymysqlimport pymysqlpymysql.install_as_MySQLdb()原创 2019-11-07 17:27:33 · 3503 阅读 · 0 评论 -
python爬虫插入MySQL数据库前去除重复数据的几种方法
在数据存储过程中,可能会遇到数据主键重复的情况,我们可以通过下面几个方法进行处理: 1. 若数据不存在插入,存在更新 2. 使用duplicate key关键字,如插入数据时发生主键冲突就更新数据 3. 使用Ingore关键字 4. 使用replace into关键字一、若数据不存在插入,存在更新:sql = "select name from table where name = ?";if: ...原创 2018-02-20 22:31:11 · 10545 阅读 · 1 评论 -
python 通过异步存储到数据库 mysql
通过异步存储到数据库from twisted.enterprise import adbapiclass MysqlTwistedPipline(object):def __init__(self, dbpool): self.dbpool = dbpool@classmethoddef from_settings(cls, settings): data_info...原创 2018-05-03 11:19:43 · 1876 阅读 · 1 评论